聪明绝顶的你与即将秃头的我

小菜鸟一枚,我会努力成为大佬的!

Domino piling

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:

1. Each domino completely covers two squares.

2. No two dominoes overlap.

3. 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
Copy
2 4
Output
Copy
4
Input
Copy
3 3
Output
Copy
4

抱着试一试的态度竟然AC了,这代码写的真少。


阅读更多
个人分类: codefoces
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

Domino piling

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭