DWITE Online Computer Programming Contest
Cubes in a Pyramid
A pyramid is to be constructed out of stone cubes, 1 meter in length each. The pyramid will have a square base, and will be completely solid. Given the dimensions for the length of the base, and the height of the pyramid, and assuming that no material is wasted, calculate the minimum number of cube stones required to construct a pyramid of the supplied dimensions.
InputTwo lines. The first contains the real number L (0 < L ≤ 100), the length of the pyramid's base. The second contains the real number H (0 < H ≤ 100), the pyramid's height.
OutputA single integer, the minimum number of blocks required for the construction.
Hint: The volume of a pyramid is V = 1/3 A*h, where A is the area of the base and h is the height.
Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Mar 19, 2010
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3