Universal and Existential Quantifiers

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

You are given a list of NN intervals. The ii-th interval is \[l_i,r_i)\[l\_i,r\_i), which denotes a range of numbers greater than or equal to l_il\_i and strictly less than r_ir\_i. In this task, you consider the following two numbers:

  • The minimum integer xx such that you can select xx intervals from the given NN intervals so that the union of the selected intervals is \[0,L)\[0,L).
  • The minimum integer yy such that for all possible combinations of yy intervals from the given NN interval, it does cover \[0,L)\[0,L).

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 NN (1N21051 \le N \le 2 \cdot 10^5) and LL (1L10121 \le L \le 10^{12}), where NN is the number of intervals and LL is the length of range to be covered, respectively. The ii-th of the following NN lines contains two integers l_il\_i and r_ir\_i (0l_i<r_iL0 \le l\_i < r\_ i \le L), representing the range of the ii-th interval \[l_i,r_i)\[l\_i,r\_i). You can assume that the union of all the NN intervals is \[0,L)\[0,L).

출력

Output two integers xx and yy mentioned in the problem statement, separated by a single space, in a line.