Codeforces Round 296 (Div. 1)
B
Clique Problem
Codeforces
未评级
原题
← AC →
翻译中…

The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph $*G*$. It is required to find a subset of vertices $*C*$ of the maximum size such that any two of them are connected by an edge in graph $*G*$. Sounds simple, doesn't it? Nobody yet knows an algorithm that finds a solution to this problem in polynomial time of the size of the graph. However, as with many other NP-complete problems, the clique problem is easier if you consider a specific type of a graph.

翻译中…

Consider $*n*$ distinct points on a line. Let the $*i*$-th point have the coordinate $*x*_{*i*}$ and weight $*w*_{*i*}$. Let's form graph $*G*$, whose vertices are these points and edges connect exactly the pairs of points $(*i*, *j*)$, such that the distance between them is not less than the sum of their weights, or more formally: $|*x*_{*i*} - *x*_{*j*}| ≥ *w*_{*i*} + *w*_{*j*}$.

翻译中…

Find the size of the maximum clique in such graph.

翻译中…

Input

翻译中…

The first line contains the integer $*n*$ ($1 ≤ *n* ≤ 200 000$) — the number of points.

翻译中…

Each of the next $*n*$ lines contains two numbers $*x*_{*i*}$, $*w*_{*i*}$ ($0 ≤ *x*_{*i*} ≤ 10^{9}, 1 ≤ *w*_{*i*} ≤ 10^{9}$) — the coordinate and the weight of a point. All $*x*_{*i*}$ are different.

翻译中…

Output

翻译中…

Print a single number — the number of vertexes in the maximum clique of the given graph.

翻译中…

Note

翻译中…

If you happen to know how to solve this problem without using the specific properties of the graph formulated in the problem statement, then you are able to get a prize of one million dollars!

翻译中…

The picture for the sample test.

翻译中…

image

翻译中…

样例

Input #1
4
2 3
3 1
6 1
0 2
Output #1
3
InputCopy OutputCopy
题目信息
题号
528B
时间限制
2 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。