#C6767. Maximum Team Members
Maximum Team Members
Maximum Team Members
You are given a series of matches, each represented by its start time and end time. You need to calculate the maximum number of team members required such that no match is interrupted. More formally, if we denote the matches as intervals [s, e], you must compute the maximum number of overlapping intervals at any point in time. This value can be expressed using the formula:
\( maxCount = \max_{t \in \mathbb{R}} \sum_{i=1}^{n} I_{[s_i,e_i]}(t) \)
where \( I_{[s_i,e_i]}(t) \) is the indicator function which is 1 if \( t \in [s_i,e_i] \) and 0 otherwise.
The input will be provided via standard input and the output should be written to standard output.
inputFormat
The first line contains an integer \( N \) representing the number of matches. The following \( N \) lines each contain two space-separated integers \( s \) and \( e \), representing the start and end times of a match.
outputFormat
Output a single integer representing the maximum number of team members required.
## sample4
1 4
2 5
6 8
6 7
2