using System; using System.Text; using System.Collections.Generic; public class Test { public static void Main() { string[] poczatek = Console.ReadLine().Trim().Split(':'); int[] czas = new int[] { int.Parse(poczatek[0]), int.Parse(poczatek[1]) }; string p; List przerwy = new List(); while ((p = Console.ReadLine()) != null) { przerwy.Add(int.Parse(p)); } int a = 0; int max = przerwy.Count; do { Console.WriteLine("{0}:{1}", czas[0], czas[1]); czas[1] += przerwy[a++]; if(czas[1]>60) { do { czas[0]++; czas[1] -= 60; } while (czas[1] > 60); } if (czas[0] > 24) { do { czas[0] -= 24; } while (czas[0] > 24); } if (czas[0] == 24) { czas[0] = 0; Console.WriteLine("{0}{1}", czas[0], czas[1]); break; } if (a > max) a = 0; } while (czas[0]+czas[1]<84); } }