Domino piling

简介: Domino piling

文章目录

一、Domino piling

总结


一、Domino piling

本题链接:Domino piling


题目:


A. Domino piling

time limit per test2 seconds

memory limit per test256 megabytes

inputstandard input

outputstandard output

You are given a rectangular board of M × N squares. Also you are given an unlimited number of standard domino pieces of 2 × 1 squares. You are allowed to rotate the pieces. You are asked to place as many dominoes as possible on the board so as to meet the following conditions:


Each domino completely covers two squares.


No two dominoes overlap.


Each domino lies entirely inside the board. It is allowed to touch the edges of the board.


Find the maximum number of dominoes, which can be placed under these restrictions.


Input

In a single line you are given two integers M and N — board sizes in squares (1 ≤ M ≤ N ≤ 16).


Output

Output one number — the maximal number of dominoes, which can be placed.


Examples

input

2 4

output

4

input

3 3

output

4

本博客给出本题截图:

image.png

题意:给一个M * N大小的方块,问在这个方块中不重合的放置1 * 2的方块最多能放多少个

AC代码

#include <iostream>
using namespace std;
int main()
{
  int n, m;
  cin >> n >> m;
  cout << n * m / 2 << endl;
  return 0;
}

总结

rectangular 长方形的

board

square 正方形

unlimited 无尽的

rotate 旋转

meet 满足

overlap 重叠

the edges of …的边缘

restriction 限制

水题,不解释


目录
相关文章
|
数据安全/隐私保护