402386: GYM100741 H Packing circles

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Packing circlestime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

You are given rectangle dimensions (W - width, H - height) and circle diameter D. How many circles can you fit inside that rectangle? Circles must be placed in rows parallel to the bottom. Each row must have the same amount of circles. Each pair of consecutive rows must have the same distance between them. A row is defined by a horizontal line. Circle belongs to a row if its center point lies on that line.

Input

A single line contains 3 integers W, H and D. (1 ≤ W, H, D ≤ 106)

Output

A single integer - the maximal amount of circles that can fit inside the rectangle with given restrictions.

ExamplesInput
2 2 2
Output
1
Input
2 2 1
Output
4

加入题单

上一题 下一题 算法标签: