Under construction

Still being built. Things may change

Air Conditioner

Time limit1sMemory limit1024 MB

Summary
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 KK 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 NN 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: NN, the day number, and KK, the number of minutes of delay. (0≤N≤1,000,0≤K<60)(0 \le N \le 1,000, 0 \le K < 60)

Output

On the first line, print MM, the number of times the air conditioner switches off on day NN.

On the following MM lines, print the times the air conditioner switches off in ascending order, in the form hh:mmhh:mm.

Examples2

  1. Example 1

    Input
    0 0
    
    Expected output
    3
    15:00
    18:00
    21:00
    
  2. Example 2

    Input
    1000 59
    
    Expected output
    3
    02:00
    05:00
    23:59