#P2255. Moolympics Recording
Moolympics Recording
Moolympics Recording
Farmer John is an avid fan of all cold-weather sports, especially those that involve cows. With the upcoming Moolympics, he wants to record as many TV programs as possible. The TV schedule consists of N different programs, where \( 1 \leq N \leq 150 \)</em> and each program has a designated starting time and ending time. Farmer John has a dual-tuner recorder that can record two programs simultaneously. Your task is to determine the maximum number of programs he can record.
inputFormat
The first line contains an integer N, the number of programs. Each of the following N lines contains two integers representing the start time and end time of a program.
Constraints:
- \( 1 \leq N \leq 150 \)
- Start and end times are integers.
outputFormat
Output a single integer, the maximum number of programs that Farmer John can record using his dual-tuner recorder.
sample
3
1 4
3 5
0 6
2