407963: GYM102951 E KRUZNICE

Memory Limit:128 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. KRUZNICEtime limit per test1 secondmemory limit per test128 megabytesinputstandard inputoutputstandard output

There are $$$N$$$ circles on the coordinate axis defined by coordinate of their center, $$$C_i$$$, and radius, $$$R_i$$$.

Please 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.

Input

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

The next N lines contain two integers each $$$C_i$$$ and $$$R_i$$$ ($$$1 \leq C_i, R_i \leq 100$$$), coordinate of the center and radius of each circle. Two circles with the same radius will always be centered at different coordinates.

Output

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

ExamplesInput
6
2 1
5 1
6 1
1 2
3 2
4 3
Output
2
Input
7
40 30
25 15
35 5
70 20
60 30
60 10
80 10
Output
2
Note

In the first example, if we remove $$$(5,1)$$$ and $$$(1,2)$$$, the remaining circles do not intersect.

The circles in the image above also correlate with the first example.

加入题单

算法标签: