Problem A
Classrooms
The new semester is about to begin, and finding classrooms for orientation activities is always a headache.
There are
There are so many proposed activities that there may not be enough classrooms to hold all the activities. It is desirable to have as many activities as possible. At most how many proposed activities can be assigned to the classrooms?
Input
-
The first line contains two positive integers
and ( ), representing the number of proposed activities and number of classrooms, respectively. -
The following
lines each contains two positive integers: the th line among these lines contains and ( ), indicating the starting time and ending time of proposed activity .
Output
Output an integer indicating the maximum number proposed activities that can be scheduled.
Sample Input 1 | Sample Output 1 |
---|---|
4 2 1 4 2 9 4 7 5 8 |
3 |