시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 29 | 12 | 11 | 42.308% |
You are given a list of $N$ intervals. The $i$-th interval is $[l_i,r_i)$, which denotes a range of numbers greater than or equal to $l_i$ and strictly less than $r_i$. In this task, you consider the following two numbers:
We ask you to write a program to compute these two numbers.
The input consists of a single test case formatted as follows.
The first line contains two integers $N$ ($1 \le N \le 2 \cdot 10^5$) and $L$ ($1 \le L \le 10^{12}$), where $N$ is the number of intervals and $L$ is the length of range to be covered, respectively. The $i$-th of the following $N$ lines contains two integers $l_i$ and $r_i$ ($0 \le l_i < r_ i \le L$), representing the range of the $i$-th interval $[l_i,r_i)$. You can assume that the union of all the $N$ intervals is $[0,L)$.
Output two integers $x$ and $y$ mentioned in the problem statement, separated by a single space, in a line.
3 3 0 2 1 3 1 2
2 3
2 4 0 4 0 4
1 1
5 4 0 2 2 4 0 3 1 3 3 4
2 4