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.
InputA single line contains 3 integers W, H and D. (1 ≤ W, H, D ≤ 106)
OutputA single integer - the maximal amount of circles that can fit inside the rectangle with given restrictions.
ExamplesInput2 2 2Output
1Input
2 2 1Output
4