| 2026 Spring UT CS104c Midterm #1 |
|---|
| Finished |
Michael is the manager of a massive 24-hour supermarket. Using cameras at the doors, he has recorded the entry and exit times for $$$N$$$ customers.
He wants to calculate the following statistic: among $$$M$$$ minutes of the day, what is the median number of customers present in the store?
The first line contains two integers, $$$N$$$ and $$$M$$$. Each of the following $$$N$$$ lines contains two integers, $$$t_{first}$$$ and $$$t_{last}$$$, representing the first and last minutes a customer spends in the store. The customer enters at the beginning of $$$t_{first}$$$ and leaves at the end of $$$t_{last}$$$.
Print the median number of customers present in the store. Your answer will be judged correct if it matches the judge solution with absolute or relative error at most $$$10^{-6}$$$.
10 101 51 82 32 93 53 64 106 87 97 10
5.5
8 91 51 82 32 93 53 66 87 9
4
In the first input, the number of customers per minute is $$$[2, 4, 6, 6, 6, 5, 6, 6, 4, 2]$$$. The median of this list is $$$5.5$$$.
| Name |
|---|


