Problems
Distribute candies among people
Distribute candies among people
Given n candies and k people. In the first turn, the first person gets 1 candy, the second gets 2 candies, and so on till k people. In the next turn, the first person gets k + 1 candies, the second person gets k + 2 candies and so on until all the sweets are distributed. If the number of candies is less than the required number of candies at every turn, then the person receives the remaining number of candies.
Find the total number of candies every person has at the end.
Input data
The number of candies n (n ≤ 10^18
) and the number of people k (k ≤ 10^6
).
Output data
Print k integers: how many candies will get each person in total.
Examples
Input example #1
7 4
Output example #1
1 2 3 1
Input example #2
10 3
Output example #2
5 2 3