Ladder of Numbers
Time limit1sMemory limit1024 MB
Numbers are written in a staircase with row r holding r numbers, and only the first k of each row remain; print rows a through b.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Valentin writes the natural numbers starting from 1 in a staircase shape: one number on the first row, two on the second, three on the third, and so on.
1
2 3
4 5 6
7 8 9 10
...
Then he erases every number on each row except the first . If a row has fewer than numbers, he keeps all of them.
You are given integers , , and . Print rows through as they remain after Valentin's erasing.
Input
The first line contains , the second line contains , and the third line contains . (, , )
Output
Print rows through that remain after Valentin's erasing. Separate the numbers in each row with spaces.