HardGreedy2000 ms256 MB
Resource Schedule
Given start and end times for workshops, determine the maximum number happening at the same time. End times are exclusive.
Statement
Given start and end times for workshops, determine the maximum number happening at the same time. End times are exclusive.
Input
First line: `n`. Next `n` lines: `start end`.
Output
Print the maximum overlap.
Constraints
- `1 <= n <= 100000`
Examples
Example 1
Input
3
1 4
2 5
6 8Output
2The first two workshops overlap.
Sample runs use visible examples. Full submissions are checked securely on the server, and private test cases are not shown in the browser.