1789.
Schedule
时间限制 2000 ms
内存限制 150 MB
There are N schedules, the i-th schedule has start time $s_i$ and end time $e_i$ (1 <= i <= N). There are some machines. Each two overlapping schedules cannot be performed in the same machine. For each machine the working time is defined as the difference between $time_{end}$ and $time_{start}$ , where time_{end} is time to turn off the machine and $time_{start}$ is time to turn on the machine. We assume that the machine cannot be turned off between the $time_{start}$ and the $time_{end}$.
Print the minimum number K of the machines for performing all schedules, and when only uses K machines, print the minimum sum of all working times.
输入数据
输出数据
For each test case, print the minimum possible number of machines and the minimum sum of all working times.
样例输入
复制
1
3
1 3
4 6
2 5
\n
\n
· \n
· \n
· \n