#C9577. Reservation Schedule Validator
Reservation Schedule Validator
Reservation Schedule Validator
You are given a list of reservations, each with a start time and an end time. A schedule is considered valid if, when the reservations are sorted by their start times, no two consecutive reservations overlap by more than \(30\) minutes. In other words, if one reservation overlaps with the following reservation, the overlap duration must not exceed \(30\) minutes.
Your task is to read the list of reservations and determine if the schedule is valid.
inputFormat
The first line contains an integer \(n\) denoting the number of reservations. Each of the next \(n\) lines contains two integers \(s\) and \(e\), representing the start time and end time of a reservation, respectively.
outputFormat
Output a single line: Valid Schedule
if the schedule is valid; otherwise, output Invalid Schedule
.
3
210 250
300 400
360 370
Invalid Schedule