fork download
  1. # your code goes here
  2. a = int(input())
  3. # t = всё время часы: 9 - t // 60 минуты: t % 60
  4. # 45 * 3 + 15 * (3 // 2) + 5 * (3 // 3)
  5. lt = a * 45
  6. t5 = 5 * (a // 2)
  7. if a >= 5 and a != 6:
  8. t15 = 15 * (a // 3) + 15
  9. else:
  10. t15 = 15 * (a // 3)
  11. t = lt + t5 + t15
  12. print(9 + t // 60, t % 60)
  13.  
  14.  
  15.  
Success #stdin #stdout 0.02s 9116KB
stdin
5
stdout
13 25