#C7181. Bird Camera Setup
Bird Camera Setup
Bird Camera Setup
In this problem, you are given two integers (n) and (k). Here, (n) denotes the total number of minutes in a day and (k) represents the length of a time interval during which the bird is guaranteed to appear at least once. In order to capture the bird's appearance, you must set up a camera at the start of every (k)-minute interval. Specifically, you should place cameras at times (0, k, 2k, \ldots) so that the time is less than (n). Your task is to determine the minimum number of cameras required as well as the exact times at which they take pictures. For example, if (n = 10) and (k = 3), then cameras should be placed at times 0, 3, 6, and 9.
inputFormat
The input consists of a single line containing two space-separated integers (n) and (k), where (n) is the total number of minutes in the day and (k) is the length of the interval in minutes.
outputFormat
Output two lines. The first line contains an integer representing the minimum number of cameras required. The second line contains the space-separated times (in minutes) at which the cameras take pictures.## sample
10 3
4
0 3 6 9
</p>