Hide

Problem D
There Was an Old Woman Who Lived in a Shoe

There was an old woman who lived in a shoe,
She had so many children, she didn’t know what to do.
She gave them some broth without any bread,
She whipped them all soundly and put them to bed.

Your task is to determine how many beds will fit in the shoe. You may assume that the shoe is rectangular, the beds are all the same size with length double the width, and placement is rectilinear in the bottom of the shoe. (There are no bunk beds.)

Input

There will be 3 lines, with one positive integer less than or equal to 100 on each line.:

  1. The width of the shoe

  2. The length of the shoe

  3. The width of the bed (the shorter distance)

Output

Print the maximum number of beds that you can fit into the shoe. Beds must be on the floor. We are not concerned about there being any floor space left for anything else.

Sample Input 1 Sample Output 1
4
6
1
12
Sample Input 2 Sample Output 2
11
11
3
4
Sample Input 3 Sample Output 3
5
5
3
0

Please log in to submit a solution to this problem

Log in