# [NOI2016] 区间

## 输入输出样例

### 输入样例 #1

6 3
3 5
1 2
3 4
2 2
1 5
1 4

### 输出样例 #1

2

## 说明

#### 样例输入输出 1 解释 ![](https://cdn.luogu.com.cn/upload/pic/2390.png) #### 数据规模与约定 本题共 20 个测试点，各测试点信息如下表。 | 测试点编号 | $n=$ | $m=$ | $l_i,r_i$ | |:-:|:-:|:-:|:-:| | 1 | $20$ | $9$ | $0 \le l_i \le r_i \le 100$ | | 2 | $20$ | $10$ | $0 \le l_i \le r_i \le 100$ | | 3 | $199$ | $3$ | $0 \le l_i \le r_i \le 100000$ | | 4 | $200$ | $3$ | $0 \le l_i \le r_i \le 100000$ | | 5 | $1000$ | $2$ | $0 \le l_i \le r_i \le 100000$ | | 6 | $2000$ | $2$ | $0 \le l_i \le r_i \le 100000$ | | 7 | $199$ | $60$ | $0 \le l_i \le r_i \le 5000$ | | 8 | $200$ | $50$ | $0 \le l_i \le r_i \le 5000$ | | 9 | $200$ | $50$ | $0 \le l_i \le r_i \le 10^9$ | | 10 | $1999$ | $500$ | $0 \le l_i \le r_i \le 5000$ | | 11 | $2000$ | $400$ | $0 \le l_i \le r_i \le 5000$ | | 12 | $2000$ | $500$ | $0 \le l_i \le r_i \le 10^9$ | | 13 | $30000$ | $2000$ | $0 \le l_i \le r_i \le 100000$ | | 14 | $40000$ | $1000$ | $0 \le l_i \le r_i \le 100000$ | | 15 | $50000$ | $15000$ | $0 \le l_i \le r_i \le 100000$ | | 16 | $100000$ | $20000$ | $0 \le l_i \le r_i \le 100000$ | | 17 | $200000$ | $20000$ | $0 \le l_i \le r_i \le 10^9$ | | 18 | $300000$ | $50000$ | $0 \le l_i \le r_i \le 10^9$ | | 19 | $400000$ | $90000$ | $0 \le l_i \le r_i \le 10^9$ | | 20 | $500000$ | $200000$ | $0 \le l_i \le r_i \le 10^9$ | 对于全部的测试点，保证 $1 \leq m \leq n$，$1 \leq n \leq 5 \times 10^5$，$1 \leq m \leq 2 \times 10^5$，$0 \leq l_i \leq r_i \leq 10^9$。