Segments
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Segments are given on a line. Determine the maximum number of segments that can be selected such that no two of them intersect. All segments are open.
Input
The first line contains the number of segments . Each of the next lines contains two integers, and , representing the starting and ending points of the -th segment.
Output
Print the maximum number of non-intersecting segments.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 2K
Acceptance rate 43%