fork download
  1. using System;
  2. using System.Text;
  3. using System.Collections.Generic;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string[] poczatek = Console.ReadLine().Trim().Split(':');
  9. int[] czas = new int[]
  10. {
  11. int.Parse(poczatek[0]),
  12. int.Parse(poczatek[1])
  13. };
  14. string p;
  15. List<int> przerwy = new List<int>();
  16. while ((p = Console.ReadLine()) != null)
  17. {
  18. przerwy.Add(int.Parse(p));
  19. }
  20.  
  21. int a = 0;
  22. int max = przerwy.Count;
  23. do
  24. {
  25. Console.WriteLine("{0:00}:{1:00}", czas[0], czas[1]);
  26. czas[1] += przerwy[a];
  27. if (czas[1] >= 60)
  28. {
  29. do
  30. {
  31. czas[0]++;
  32. czas[1] -= 60;
  33. } while (czas[1] >= 60);
  34. }
  35. if (czas[0] > 24)
  36. {
  37. do
  38. {
  39. czas[0] -= 24;
  40. } while (czas[0] > 24);
  41. }
  42. if (czas[0] == 24)
  43. {
  44. czas[0] = 0;
  45. Console.WriteLine("{0:00}:{1:00}", czas[0], czas[1]);
  46. break;
  47. }
  48. if (a > max)
  49. a = 0;
  50. } while (czas[0] + czas[1] < 84);
  51. }
  52. }
  53.  
Success #stdin #stdout 0.04s 37032KB
stdin
08:00
15
15
15
stdout
08:00
08:15
08:30
08:45
09:00
09:15
09:30
09:45
10:00
10:15
10:30
10:45
11:00
11:15
11:30
11:45
12:00
12:15
12:30
12:45
13:00
13:15
13:30
13:45
14:00
14:15
14:30
14:45
15:00
15:15
15:30
15:45
16:00
16:15
16:30
16:45
17:00
17:15
17:30
17:45
18:00
18:15
18:30
18:45
19:00
19:15
19:30
19:45
20:00
20:15
20:30
20:45
21:00
21:15
21:30
21:45
22:00
22:15
22:30
22:45
23:00
23:15
23:30
23:45
00:00