#ABC478A. 葡萄 / Grapes
葡萄 / Grapes
Problem Statement
There are people numbered from to .
There are grapes. They will be distributed to the people as follows.
- Give one grape each to persons in this order. If the grapes run out midway, the distribution ends at that point.
- If there are still grapes remaining after giving to person , go back to person and distribute in order again. Repeat this until the grapes run out.
Find how many grapes each person receives.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Output lines. The -th line should contain the number of grapes person receives.
3 5
2
2
1
The five grapes are given one at a time to persons in this order.
4 1
1
0
0
0
There may be people who receive no grape.
12 3456
288
288
288
288
288
288
288
288
288
288
288
288
Everyone may receive the same number of grapes.
- Source: AtCoder ABC 478 A
相关
在下列比赛中: