KRUZNICE | 프로그래밍의 벗 PivotOJ
PivotOJ

KRUZNICE

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2010 School Competition - SeniorsBOJ 3102
이 문제는 본문 이미지 일부가 표시되지 않습니다. 텍스트만으로 풀이가 어려울 수 있습니다.

문제

There are N circles on the coordinate axis defined by coordinate of the center Ci and radius Ri.

[이미지 1]

Write a program that will determine the smallest number of circles that have to be removed such that there is no intersecting pair of circles among the remaining circles. Remaining circles are allowed to touch at one point.

입력

The first line contains one integer N (1 ≤ N ≤ 1000), number of circles. 

The next N lines contain two integers each Ci and Ri (1 ≤ Ci, Ri ≤ 100), coordinate of the center and radius of each circle. Two circles with the same radius will always be centered at different coordinate. 

출력

Output one integer, the smallest number of circles that have to be removed such that no pair of remaining circles intersects. 

힌트

Clarification for the first sample: If we remove (5 1) and (1 2), the remaining circles do not intersect.

예제

예제 1

입력
6
2 1
5 1
6 1
1 2
3 2
4 3
출력
2

예제 2

입력
7
40 30
25 15
35 5
70 20
60 30
60 10
80 10
출력
2
코드를 제출하려면 로그인하세요.