#Q8. 「一本通 1.1 练习 3」线段
「一本通 1.1 练习 3」线段
Description
There are segments on the number line. Select segments from them such that no two segments overlap. Find the maximum possible value of .
Input Format
The first line contains a positive integer ;
In the following lines, each line contains two numbers and , describing each segment.
Output Format
Output an integer, the maximum value of .
Sample 1
3
0 2
2 4
1 3
2
Data Range and Hints
For of the data, ;
For of the data, ;
For of the data, ;
For of the data, , .