Air Conditioner
Time limit1sMemory limit1024 MB
Given day N and a clock delay of K minutes, list every time the air conditioner switches off on day N, where each third shutoff stops the internal clock for K minutes.
- Level
Easy3 of 10
- Topics
- Simulation, Implementation
- Solved
- No attempts yet
Problem
Most DGIST undergraduate students live in the dormitory. As summer approaches, they will use a cool air conditioner whose temperature can be set freely. Unfortunately, the air conditioner is designed to switch off automatically every day at exactly 15:00, 18:00, and 21:00. Also, its internal clock is broken, so every time it switches off for the third time, the clock stops for minutes.
Jung Digi wanted a machine that turns the air conditioner back on exactly on the hour, so she can take a comfortable nap. She became angry when the air conditioner did not turn on at the right time. Before she assigns a circuit theory project, you need to build a machine that predicts the time the air conditioner switches off on day and turns it on again, so that Jung Digi stops being angry. (Days start at 00:00 on day 0, and the air conditioner is on at the start.)
Input
Two integers are given on one line, separated by a space: , the day number, and , the number of minutes of delay.
Output
On the first line, print , the number of times the air conditioner switches off on day .
On the following lines, print the times the air conditioner switches off in ascending order, in the form .