Tower
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Inspired by the legend of the Tower of Babel, Petro decided to construct a similar structure in his room. He used W children's building bricks, selected a base size of D, and aimed for a tower height of H. He also decided that the size of each successive level could differ from the previous one by no more than one brick. The tower shown in the picture satisfies Petro's criteria, with a base size of 2, a height of 8, and a total of 22 bricks.
Input
Three integers W, D, H (in that order), separated by spaces (1 ≤ W ≤ 1000, 1 ≤ D, H ≤ 30)
Output
If a tower can be constructed that meets Petro's requirements, output H numbers representing the number of bricks on each level, starting from the bottom. If no such tower can be built, output 0.
Examples
Input #1
Answer #1
Submissions 183
Acceptance rate 15%