### DWITE Online Computer Programming Contest

October 2007

### Problem 2

## 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.

### Input

Two 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.

### Output

A single integer, the minimum number of blocks required for the construction.### Sample Input

10.0 5.0

### Sample Output

167

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.

All Submissions

Best Solutions

**Point Value:** 5

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Mar 19, 2010

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

Mehar_Son Jan 20, 2016 - 11:22:26 pm UTC why doesnt it work?Venkat24on Jan 20, 2016 - 11:46:51 pm UTC Re: why doesnt it work?Venkat24on Jan 20, 2016 - 11:47:39 pm UTC Re: why doesnt it work?Mehar_Son Jan 20, 2016 - 11:56:21 pm UTC Re: why doesnt it work?Venkat24on Jan 17, 2016 - 3:15:29 am UTC pls helpVenkat24on Jan 17, 2016 - 3:19:09 am UTC Re: pls helpVenkat24on Jan 17, 2016 - 3:25:06 am UTC Re: pls helproyanitra04on Jan 17, 2016 - 9:47:36 pm UTC Re: pls helpjargonon Jan 17, 2016 - 8:40:52 pm UTC Re: pls help