
ZOJ Problem Set  2510
There are several different concentric rings on the ground. Some of them may overlap. In Figure 1, there are 3 rings: blue, green and red. The red one is just above the green one. The problem is to remove minimum number of rings so that no two of the remaining overlap. Figure 1 The input consists of multiple test cases. Each test case starts with a positive integer N (<=10000) which represents the number of rings. The next N lines each line contains two positive integers which represents the inner radius and outer radius respectively. OutputFor each test case, output the minimum number of rings to remove. Sample Input:3 1 2 3 6 4 5Sample Output: 1 Author: XU, Chuan Source: CYJJ's Funny Contest #1, Killing in Seconds 