| IU Programming Challenge 2024 |
|---|
| Finished |
There are $$$n$$$ assignments in a course, and $$$d$$$ days in the semester. Assignment $$$i$$$ is assigned at the start of day $$$S_i$$$ and is due by the end of day $$$E_i$$$. Thus, you can work on assignment $$$i$$$ on any day $$$t$$$ such that $$$S_i \leq t \leq E_i$$$.
The professor has a forgiveness policy, where she will drop at most $$$k$$$ missed assignments from the final grade.
You have recently been obsessed with Honkai Star Rail, and decide that you will only complete at most one assignment per day, to make time for your daily quests. As an optimally lazy student, what is the minimum number of missed assignments on your final grade?
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases.
The first line of each test case contains three integers $$$n$$$, $$$d$$$, and $$$k$$$ ($$$1 \leq n,d \leq 2\cdot10^5$$$, $$$0 \leq k \leq n$$$) — the number of assignments, the number of days in the semester, and the maximum number of forgiven assignments, respectively.
Each of the following $$$n$$$ lines contains two integers $$$S_i$$$ and $$$E_i$$$ ($$$1 \leq S_i \leq E_i \leq d$$$) — the assignment start date and end date.
It is guaranteed that the sum of $$$n$$$ over all test cases is at most $$$2 \cdot 10^5$$$, and the sum of $$$d$$$ over all test cases is at most $$$2 \cdot 10^5$$$.
For each test case, output the minimum number of points you will lose if you complete at most one assignment per day.
32 1 01 11 13 2 11 11 22 29 16 01 81 53 121 31 32 42 41 13 6
1 0 1
| Name |
|---|


