You are given n segments, from which you need to remove the minimum number of segments so that the remaining segments do not have common interior points.
The number of segments in the first line, n(1≤n≤105).
The next n lines contain segments, ai,bi(1≤ai≤bi≤109).
Print the number of segments remaining after deletion.
In the following lines, print the segments themselves.
If there are multiple solutions, print any of them.
3 3 6 1 3 2 5
2 1 3 3 6
Login to be able to submit.
Problem | ||
---|---|---|
A1 | Body Mass Index #1 | 63 |
A2 | Body Mass Index #2 | 61 |
B | Decision tree | 56 |
C | Outputting numbers in waves | 31 |
D | Filling an array | 39 |
E | Fix it | 26 |
F | Atlas of Khorezmstan | 6 |
G | Covering | 10 |
H | Number prefixes and suffixes | 2 |
I | Prefixes on segments | 2 |
J | Meta-problem | 5 |