Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hour_exam = int(input())
- min_exam = int(input())
- hour_stu = int(input())
- min_stu = int(input())
- hh = 0
- mm = 0
- if hour_exam == (hour_stu + 1):
- if min_exam < min_stu:
- mm = min_exam + (60 - min_stu)
- else:
- hh = hour_exam - hour_stu
- mm = min_stu - min_exam
- if mm == 0:
- print("Early")
- print(f"{hh}:{mm:02d} hours before the start")
- else:
- pass
- if min_exam == 0 and mm != 0:
- mm = 60 - min_stu
- print("On time")
- if min_stu == 00:
- pass
- else:
- print(f"{mm:02d} minutes before the start")
- else:
- if hour_exam == hour_stu:
- print("Early")
- print(f"{mm:02d} minutes before the start")
- elif min_exam != min_stu:
- print("Early")
- print(f"{mm:02d} minutes before the start")
- elif hour_exam == hour_stu:
- mm = min_exam - min_stu
- if 0 <= mm <= 30:
- if min_exam == 0:
- mm = 60 - min_stu
- print("On time")
- if min_stu == 00:
- pass
- else:
- print(f"{mm:02d} minutes before the start")
- else:
- print("Early")
- print(f"{mm:02d} minutes before the start")
- elif 30 < mm < 59:
- print("Early")
- print(f"{mm:02d} minutes before the start")
- elif mm < 0:
- print("Late")
- print(f"{abs(mm):02d} minutes after the start")
- elif hour_exam > hour_stu:
- hh = hour_exam - hour_stu
- mm = min_stu - min_exam
- print("Early")
- print(f"{hh}:{abs(mm):02d} hours before the start")
- else:
- if min_stu < min_exam:
- mm = min_stu + (60 - min_exam)
- print("Late")
- print(f"{mm:02d} minutes after the start")
- else:
- hh = hour_stu - hour_exam
- mm = min_stu - min_exam
- print("Late")
- print(f"{hh}:{abs(mm):02d} hours after the start")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement