#K75072. Minimum Servers Required
Minimum Servers Required
Minimum Servers Required
You are given a list of jobs. Each job is defined by its start time and end time. Multiple jobs may overlap in time, and a single server can only handle one job at a time.
Your task is to determine the minimum number of servers required so that all jobs can be processed without any overlapping on the same server.
Note: If there are no jobs, then no server is required. Mathematically, if you have jobs with start times \(s_i\) and end times \(e_i\) (for \(i=1,2,\dots,n\)), then the answer is the maximum value of overlapping intervals at any moment in time.
inputFormat
The first line of input contains an integer \(n\) representing the number of jobs. Each of the following \(n\) lines contains two space-separated integers \(s\) and \(e\), where \(s\) is the start time and \(e\) is the end time of a job.
outputFormat
Output a single integer, which is the minimum number of servers required to process all the jobs without overlapping on any server.
## sample5
1 4
2 5
9 12
5 9
5 7
2