Day 2 - Madison

You arrive at Fountain Paintpots only to learn that you just missed a simultaneous eruption of Fountain, Morning, Morning’s Thief, Jet, Frying Pan, Kaliedoscope, and several other geysers.

While eruptions are not predictable in the basin, a simultaneous eruption is (somewhat) predicable. Each geyser has a period and duration. The simultaneous eruption occurs when, for every geyser, the number of minutes from the previous simultaneous eruption, divided by the period has a remainder of the duration.

For example, suppose you have this input, and the last eruption was midnight May 1st:

geyser,period,duration
Fountain,444,9
Morning,375,51

The number of minutes is 41301:

Geyser Period Duration Result
Fountain 444 9 41301 / 444 = 93 remainder 9
Morning 375 51 41301 / 375 = 110 remainder 51

41301 minutes after midnight May 1st is 05:29:16:21, in mm:dd:hh:mm format (month:day:hour:minute using a 24-hour clock).

You missed the eruption at midnight of June 1st. 
When it the next simultaneous eruption? Give the answer as mm:dd:hh:mm, using a 24-hour clock.

Input

Test input

Hints

Copyright 2022 Robin A. Reynolds-Haertle