Chain Reaction

题意翻译

有 $n$ 个激光塔排成一行,第 $i$ 个激光塔的位置为 $a_i$ ,威力是 $b_i$ 当第 $i$ 个激光塔被激活后,对于任意其他激光塔 $j$ ,如果 $0 < a_i-a_j \le b_i$ ,则激光塔 $j$ 被摧毁。 添加一个新激光塔 $k$ ,使 $a_k > \text{max}\{a_1,a_2, ... ,a_n\}$ 管理员现在开始开始从右到左依次激活每个激光塔,如果一个激光塔被摧毁了,那就不激活。 请调整 $a_k$ 和 $b_k$ ,使被摧毁的激光塔总数最少。

题目描述

There are $ n $ beacons located at distinct positions on a number line. The $ i $ -th beacon has position $ a_{i} $ and power level $ b_{i} $ . When the $ i $ -th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within distance $ b_{i} $ inclusive. The beacon itself is not destroyed however. Saitama will activate the beacons one at a time from right to left. If a beacon is destroyed, it cannot be activated. Saitama wants Genos to add a beacon strictly to the right of all the existing beacons, with any position and any power level, such that the least possible number of beacons are destroyed. Note that Genos's placement of the beacon means it will be the first beacon activated. Help Genos by finding the minimum number of beacons that could be destroyed.

输入输出格式

输入格式


The first line of input contains a single integer $ n $ ( $ 1<=n<=100000 $ ) — the initial number of beacons. The $ i $ -th of next $ n $ lines contains two integers $ a_{i} $ and $ b_{i} $ ( $ 0<=a_{i}<=1000000 $ , $ 1<=b_{i}<=1000000 $ ) — the position and power level of the $ i $ -th beacon respectively. No two beacons will have the same position, so $ a_{i}≠a_{j} $ if $ i≠j $ .

输出格式


Print a single integer — the minimum number of beacons that could be destroyed if exactly one beacon is added.

输入输出样例

输入样例 #1

4
1 9
3 1
6 1
7 4

输出样例 #1

1

输入样例 #2

7
1 1
2 1
3 1
4 1
5 1
6 1
7 1

输出样例 #2

3

说明

For the first sample case, the minimum number of beacons destroyed is $ 1 $ . One way to achieve this is to place a beacon at position $ 9 $ with power level $ 2 $ . For the second sample case, the minimum number of beacons destroyed is $ 3 $ . One way to achieve this is to place a beacon at position $ 1337 $ with power level $ 42 $ .