407755: GYM102890 F Fit them all

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Fit them alltime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

One of the problems in Jaime's package delivery company is to load platforms with the packages that need to be delivered in a day. Each day Jaime needs to ship packages in a platform with a rectangular shape of size $$$W$$$ width and $$$H$$$ height, these packages are contained in cubic boxes of different sizes, but, as Jaime loves sequences, he always loads the platforms starting with a box with size 1x1x1, then with a box with size 2x2x2, and the $$$K$$$-th loaded box in the truck will be of size KxKxK. Since all the packages contain fragile material, the boxes can not be stacked, this is, a box can not be over another box, but they can be placed side by side without leaving any empty space between them.

Jaime needs your help to find the maximum number of packages that can be loaded in a given platform.

Input

The first and only line of input contains two integer numbers separated by a space, $$$W$$$ and $$$H$$$ ($$$1 \leq W, H \leq 30$$$), representing the width and height of the rectangular shaped platform.

Output

Output a line containing a single integer, the maximum number of boxes that can be loaded into the platform.

ExamplesInput
2 2
Output
1
Input
4 3
Output
2

加入题单

上一题 下一题 算法标签: