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. a++;
  49. if (a > max)
  50. a = 0;
  51. } while (czas[0] + czas[1] < 84);
  52. }
  53. }
  54.  
Runtime error #stdin #stdout 0.04s 39632KB
stdin
08:00
15
15
15
stdout
08:00
08:15
08:30
08:45