#K75582. Maximum Customers in Store
Maximum Customers in Store
Maximum Customers in Store
Given the number of log entries and the corresponding entry and exit times of customers in a store, determine the maximum number of customers present simultaneously at any given time.
The first line of the input contains an integer \( n \) representing the number of log entries. The following \( n \) lines each contain two integers \( s \) and \( t \), representing the entry time and exit time of a customer, respectively.
Your task is to compute the maximum number of customers that were in the store at the same time. Note that if a customer leaves at the same time another one enters, they are not considered to be in the store at the same moment.
inputFormat
The input is given in the following format:
n s1 t1 s2 t2 ... sn tn
Here, \( n \) is a non-negative integer representing the number of log entries, and each of the following \( n \) lines contains two integers \( s_i \) and \( t_i \) representing the entry and exit time of the \( i \)-th customer.
outputFormat
Output a single integer which is the maximum number of customers present in the store at the same time.
## sample3
1 4
2 6
4 7
2