#C10227. Water Stations Placement

    ID: 39409 Type: Default 1000ms 256MiB

Water Stations Placement

Water Stations Placement

Problem Description:

In a race, water stations are required along the track to support the racers. Given the total distance of the race (d) and the desired number of water stations (n), your task is to determine the positions at which the water stations should be installed. The stations are to be equally spaced when possible. Formally, if (n < d), the positions should be at the multiples of (\lfloor\frac{d}{n}\rfloor) (i.e. at (\lfloor\frac{d}{n}\rfloor, 2\lfloor\frac{d}{n}\rfloor, \dots, n\lfloor\frac{d}{n}\rfloor)). If (n \ge d), then there is a station at every integer position from 1 to (d).

For example:
(d = 10,\ n = 4) yields positions: 2, 4, 6, 8.
(d = 15,\ n = 3) yields positions: 5, 10, 15.
(d = 5,\ n = 10) yields positions: 1, 2, 3, 4, 5.

inputFormat

Input Format:
A single line with two space‐separated integers (d) and (n), where (d) is the total distance of the race and (n) is the number of desired water stations.

outputFormat

Output Format:
A single line with the calculated positions of the water stations, printed as space-separated integers.## sample

10 4
2 4 6 8