#C5029. Evenly Spaced Watchtowers

    ID: 48633 Type: Default 1000ms 256MiB

Evenly Spaced Watchtowers

Evenly Spaced Watchtowers

You are given the circumference C of a circular area and the number k of watchtowers to be placed along its perimeter. The watchtowers are to be placed so that the distance between any two adjacent watchtowers is identical. In other words, if the distance between adjacent watchtowers is denoted by d, then

[ d = \left\lfloor \frac{C}{k} \right\rfloor ]

where \lfloor x \rfloor denotes the floor of x (i.e. the greatest integer less than or equal to x). For each dataset, compute and output a single line containing k integers which are the computed distance d repeated k times, separated by a single space.

The input consists of multiple datasets. Each dataset is given on a separate line in the format "C k". The input is terminated by a line containing a single zero ("0").

inputFormat

The input is read from standard input (stdin). It consists of several datasets. Each dataset is represented on a single line by two space-separated integers: the circumference C and the number of watchtowers k. A line containing a single zero indicates the end of input.

Example:

100 4
200 5
360 6
0

outputFormat

For each dataset (except the terminating line), output a line to standard output (stdout) that contains k space-separated integers. Each integer represents the distance between adjacent watchtowers, computed as \(d = \lfloor C/k \rfloor\).

Example Output:

25 25 25 25
40 40 40 40 40
60 60 60 60 60 60
## sample
100 4
200 5
360 6
0
25 25 25 25

40 40 40 40 40 60 60 60 60 60 60

</p>