peterverebics/CodeNet_Python_118 huggingface dataset:
n = int(input())
lr = []
for _ in range(n):
    x, l = map(int, input().split())
    lr.append((x-l, x+l))
lr = sorted(lr, key=lambda x:x[0])
prev = lr[0]
ans = 1
for i in range(1, n):
    if prev[1] <= lr[i][0]:
        ans += 1
        prev = lr[i]
    else:
        if prev[1] > lr[i][1]:
            prev = lr[i]

print(ans)
n = int(input())
ar = []
mi = 0
mx = 0
count = 1
for i in range(n):
    a,b = map(int,input().split(" "))
    br = [a+b,a-b]
    ar.append(br)
ar.sort()
for i,r in enumerate(ar):
    if i == 0:
        mx = r[0]
    else:
        if mx <= r[1]:
            count += 1
            mx = r[0]
print(count)
n = int(input())
lis = []
for i in range(n):
    a,b =map(int,input().split())
    lis.append([a-b,a+b])
lis.sort(key = lambda x:x[1])
ans = 0
now = -10 ** 10
for a,b in lis:
    if now <= a:
        ans += 1
        now = b
print(ans)
n = int(input());

sf = [ [0]*2 for i in range(n) ];
for i in range(n) :
	xl = input().split(' ');
	sf[i][0] = int(xl[0]) - int(xl[1]);
	sf[i][1] = int(xl[0]) + int(xl[1]);
	

sf.sort(key=lambda x:x[1] );

ans = 1;
end = sf[0][1];
for i in range(1,n) :
	if end <=  sf[i][0] :
		end = sf[i][1];
		ans += 1;

print(ans);
n = int(input())

robots = []

for i in range(n):
    x,l = map(int, input().split())
    robots.append((x+l, x-l))

INF = 1e10
last = -INF
    
robots.sort()

ans = 0
for (r, l) in robots:
    if l < last:continue
    ans += 1
    last = r

print(ans)
import sys
def input():
    return sys.stdin.readline()[:-1]
N=int(input())
l=[None]*N
for i in range(N):
    X,L=map(int,input().split())
    l[i]=(X-L,X+L)
l.sort(key=lambda x: x[1])
t=-10**12
a=0
for i in l:
    if t<=i[0]:
        a+=1
        t=i[1]
print(a)
N = int(input())
XL = [list(map(int, input().split())) for x in range(N)]

XL = sorted(XL, key=lambda x: x[0]+x[1])

cnt = 0
prev_right = -10**9+10
for x, l in XL:
    left = x - l
    right = x + l
    if left >= prev_right:
        cnt += 1
        prev_right = right

print(cnt)
n = int(input())
A = []
for i in range(n):
    x,l = map(int,input().split())
    a = x -l
    b = x + l
    A.append((b,a))
A.sort()

ans = 0
prev = -10**9 - 7

for i in range(n):
    if A[i][1] >= prev:
        prev = A[i][0]
        ans += 1
print(ans)
n = int(input())

arms = []
for i in range(n):
  x, l = [int(i) for i in input().split(' ')]
  arms.append({"st": x-l, "ed": x+l})

arms.sort(key=lambda x: x["ed"])

n_arm = 1
tot_end = arms[0]["ed"]

for i in range(1, n):
  if tot_end <= arms[i]["st"]:
    n_arm += 1
    tot_end = arms[i]["ed"]

print(n_arm)
N = int(input())
num_list = [[int(item) for item in input().split()] for _ in range(N)]
num_list2 = []
for x, l in num_list:
    num_list2.append([x-l, x+l])

num_list2.sort(key=lambda x: x[1]) 
# print(num_list2)

temp_max = num_list2[0][1]
cnt = 1

for l, h in num_list2:
    if l >= temp_max:
        cnt += 1
        temp_max = h

print(cnt)
N = int(input())
LR = [None] * N
for i in range(N):
    center, length = [int(i) for i in input().split()]
    LR[i] = (center + length, center - length)  # right, left
LR.sort()
now = LR[0][0]
ans = 1
for i in range(1, N):
    right, left = LR[i]
    if now > left:
        continue
    else:
        ans += 1
        now = right
print(ans)
N = int(input())
# X, L = [], []
A = []
for i in range(N):
    x, l = map(int, input().split())
    # X.append(x)
    # L.append(l)
    A.append((x - l, x + l))

A.sort(key=lambda x: x[1])
ans = 0
x = -10e50
for i in range(N):
    l, r = A[i]
    if x <= l:
        ans += 1
        x = r

print(ans)


# 選べるロボットの中で最もX+Lが小さいもの
import sys
input = sys.stdin.readline
N = int(input())
xl = []
for i in range(N):
    x, l = [int(i) for i in input().split()]
    xl.append((x, l, x+l))
xl.sort(key=lambda x: x[2])
n = xl[0][2]
ans = 1
for x, l, s in xl[1:]:
    if x-l >= n:
        ans += 1
        n = s
print(ans)
n=int(input())

lr=[]

for _ in range(n):
    x,l=map(int,input().split())
    lr.append([x+l,x-l])

lr.sort()

cnt=0
point=lr[0][1]-1

for item in lr:
    if item[1]>=point:
        cnt+=1
        point=item[0]

print(cnt)
N = int(input())

p = []
for i in range(N):
  a,b = map(int,input().split())
  p.append([max(0,a - b),a + b])
  
q = sorted(p,key=lambda x:x[1])  

cnt = 0
d = q[0][1]
for j,k in q[1:]:
  if j < d:
    cnt += 1
  else:
    d = k

print(N-cnt)
import sys
N = int(input())
a = sorted([(x+l, x-l) for x, l in (map(int, l.split()) for l in sys.stdin)])

last = a[0][0]
ans = 1

for r, l in a[1:]:
    if(last <= l):
        ans += 1
        last = r
print(ans)
N = int(input())
XL = sorted(list(map(int, input().split())) for _ in range(N))

i, j = 0, 1
count = N
while j < N:
  if XL[i][0] + XL[i][1] > XL[j][0] - XL[j][1]:
    if XL[i][0] + XL[i][1] < XL[j][0] + XL[j][1]:
      j += 1
    else:
      i, j = j, j + 1
    count -= 1
  else:
    i, j = j, j + 1
print(count)
from operator import itemgetter

n = int(input())
xl = []

for i in range(n):
    x, l = map(int, input().split())
    xl.append([x - l, x + l])

xl = sorted(xl, key=itemgetter(1))

ans = 0
m = -float("inf")
for left, right in xl:
    if left < m:
        ans += 1
    else:
        m = max(m, right)

print(n - ans)
N = int(input())
R = []
for i in range(N):
	X,L = map(int,input().split())
	R.append((X+L,X-L))
R.sort()
ans = 0
right = None
for x in R:
	l,r = x[1], x[0]
	if right == None:
		ans += 1
		right = r
	else:
		if l >= right:
			ans += 1
			right = r

print(ans)
N = int(input())
X = []
for i in range(N):
    x,l = map(int, input().split())
    X.append([x-l, x+l])
X.sort()
#print(X)

count = N
temp = X[0][1]
for i in range(N-1):
    if X[i+1][0] < temp:
        count -= 1
        temp = min(temp, X[i+1][1])
    else:
        temp = X[i+1][1]
    #print(temp)

print(count)
n=int(input())
r=[]
for _ in range(n):
    s,t=map(int,input().split())

    r.append([s-t,s+t])

r=sorted(r,key=lambda x: x[1])


ans=[r[0]]
for i in range(1,n):
    if r[i][0]>=ans[-1][1]:
        ans.append(r[i])

        


print(len(ans))
N = int(input())

a_list = []
for i in range(N):
  x, l = map(int, input().split())
  a_list.append([x - l, x + l])
  
b_list = sorted(a_list, key=lambda x:x[0])
cnt = N
start, end = map(int, b_list[0])
for i in range(1,N):
  start_, end_ = map(int, b_list[i])
  if start_ < end:
    if end_ <= end:
      cnt -= 1
      start = start_
      end = end_
      continue
    else:
      cnt -= 1
      continue
  else:
    start = start_
    end = end_
      
      
print(cnt)
N=int(input())
XL=[list(map(int,input().split())) for _ in range(N)]
s,e=0,0
L=[]
for xl in XL:
    x,l=xl[0],xl[1]
    s,e=x-l,x+l
    L.append([e,s])
L.sort()
end=L[0][0]
len_L=len(L)
ans=1
for i in range(1,len_L):
    if end<=L[i][-1]:
        ans+=1
        end=L[i][0]
print(ans)
N = int(input())
XL = [list(map(int,input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0]+x[1])
M = XL[0][0]+XL[0][1]-1
ans = 0
for i in range(1,N):
    if M >= XL[i][0]-XL[i][1]:
        ans += 1
    else:
        M = XL[i][0]+XL[i][1]-1
print(N-ans)
from operator import itemgetter
N= int(input())
ans = 1
a = []

for i in range(N):
    tmpa, tmpb = map(int,input().split())
    a.append([tmpa+tmpb, tmpa-tmpb])

a.sort()
    
tmp = a[0][0]
for i in range(1, N):
    if a[i][1] >= tmp:
        ans += 1
        tmp = a[i][0]
print(ans)
import sys
input = sys.stdin.readline
n = int(input())
c = []
for i in range(n):
  l,x = map(int,input().split())
  c.append((l-x,l+x))
  
from operator import itemgetter
c = sorted(c,key=itemgetter(0))
c = sorted(c,key=itemgetter(1))

ans = 1
chk = c[0][1]
for i,j in c:
  if i >= chk:
    ans +=1
    chk = j
    
print(ans)
n=int(input())

ts=[]

for i in range(n):
  x,l=map(int,input().split())
  ts.append((x+l,x-l))
  
ts.sort()

#print(ts)
ans=0
old=-10**10
for i,j in ts:
  
  if j>=old:
    old=i
  else:
    ans+=1

print(n-ans)
n = int(input())
l = []
for i in range(n):
    p,q = map(int,input().split())
    l.append((p+q,p-q))
l.sort()
c = -float('inf')

count = 0

for i in range(n):
    if l[i][1]<c:
        count+=1
    else:
        c = l[i][0]
print(n-count)
N = int(input())
st = []
for i in range(N):
  x,l=map(int,input().split())
  s = max(x-l,0)
  t = min(x+l,10**9)
  st.append([t,s])
st.sort()

count = 0
lastT=0
for i in range(N):
  if st[i][1]>=lastT:
    count+=1
    lastT = st[i][0]
    
print(count)
#キーエンスプログラミングコンテスト2022-B-Robot Arms
n = int(input())
arm = []
for i in range(n):
    r,l = map(int,input().split())
    arm.append([r+l, r-l])
    
arm.sort()

ans = 1

max_r = arm[0][0]

for i in range(n-1):
    
    if max_r <= arm[i+1][1]:
        ans += 1
        max_r = arm[i+1][0]
        

print(ans)
N=int(input())
A=[]
ans=1
for i in range(N):
    Xi,Li=map(int,input().split())
    A.append([Xi-Li,Xi+Li])
A.sort(key=lambda x:x[1])

def interf(A1,A2):
    if A1[1]>A2[0]:
        return 1
    else:
        return 0
    
pre=A[0]
for i in range(1,N):
    if interf(pre,A[i])==0:
        ans+=1
        pre=A[i]
print(ans)
n=int(input())
X=[]
for i in range(n):
    x,l=map(int,input().split())
    X.append([x-l,l+x])

X.sort(key=lambda x:x[1])

a=X[0][0]-1
ans=0
for i in range(n):
    if X[i][0]<a:
        continue
    else:
        a=X[i][1]
        ans+=1
        
print(ans)
N = int(input())
kukan = [[] for _ in range(N)]
for i in range(N):
    X, Len = map(int, input().split())
    kukan[i] = [X - Len, X + Len]

kukan.sort(key=lambda x: x[1])
# kukan

p = -10 ** 9
ans = 0
for k in kukan:
    if p <= k[0]:
        # ok
        ans += 1
        p = k[1]
        pass
    else:
        # ng
        pass
print(ans)
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

newXL = sorted([[x-l, x+l] for x, l in XL], key=lambda x:x[1])

previous = 0
total = 1

for i in range(1, N):
  if newXL[i][0] < newXL[previous][1]:
    pass
  else:
    previous = i
    total += 1
    
print(total)
n = int(input())
list_ = []
for _ in range(n):
    x, l = map(int, input().split())
    list_.append([x-l, x+l])

list_.sort(key=lambda x: x[1])

res = n
pos = -float('inf')
for l, r in list_:
    if l < pos:
        res -= 1
    else:
        pos = r

print(res)
N=int(input())
INF=10**20
 
X=[]
for i in range(N):
  x,l=map(int,input().split())
  X.append((x-l,x+l-1))
  
X = sorted(X,key=lambda x:x[1])

last=0
ans=1
for i in range(1,N):
  if X[last][1]<X[i][0]:
    ans += 1
    last=i
  else:
    continue
    
print(ans)
import math
N = int(input())
X = []
for _ in range(N):
  x, l = map(int,input().split())
  X.append([x+l, x-l])
sorted_X = sorted(X, key=lambda x:(x[0], x[1]))
ans = 1
cnt = sorted_X[0][0]
for i in range(N):
  if sorted_X[i][1] >= cnt:
    ans += 1
    cnt = sorted_X[i][0]
print(ans)
n = int(input())
li = []
for _ in range(n):
    a,b = map(int,input().split())
    li.append([a+b,a-b])
li.sort()
#print(li)
last = 0
count = 0
for i,l in enumerate(li):
    if i == 0:
        last = l[0]
        count += 1
        continue
    #print(l,l[1],last,'last')
    if l[1]>=last:
        count += 1
        last = l[0]
print(count)
a=int(input())
List=[]
for i in range(a):
  p,q=map(int,input().split())
  List.append([p-q,p+q])
List=sorted(List, key=lambda x:x[1])
ans=0
t=-10000000000
for i in range(a):
  if t<=List[i][0]:
    ans+=1
    t=List[i][1]
print(ans)
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
INF=10 ** 10
N = int(input())
XL = [list(map(int,input().split())) for _ in range(N)]
XLs =sorted([ [xl[0]+xl[1],xl[0]-xl[1]] for xl in XL ])
# print(N,XL,XLs)

t = -INF 
n = 0

for xl in XLs:
    if t <= xl[1]:
        t = xl[0]
        n = n + 1
print(n)
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):
    return map(type,input().split())

#%%code
def resolve():
    N=int(input())
    A=[tuple(pin())for i in range(N)]
    A.sort(key=lambda x:x[0]+x[1])
    ans=0
    jama=-10000000000#int value
    for i in range(N):
        if A[i][0]-A[i][1]>=jama:
            jama=sum(A[i])
            ans+=1
            
    print(ans)
#%%submit!
resolve()
def main():
    N, *XL = map(int, open(0).read().split())
    # print(N, XL)
    robots = [0]*N
    for i in range(N):
        X, L = XL[2 * i + 0], XL[2 * i + 1]
        robots[i] = (X - L, X + L)
    robots.sort(key=lambda x: x[1])
    # print(robots)
    ans = 0
    last = robots[0][0] - 1
    for robot in robots:
        if last <= robot[0]:
            last = robot[1]
            ans += 1

    print(ans)

if __name__ == '__main__':
    main()
N = int(input())
xl = []
for i in range(N):
  x,l =[int(x) for x in input().split()]
  a = max(x-l,0)
  xl.append([a,x+l])
xl = sorted(xl,key = lambda x:x[1])
#print(xl)
minx=xl[0][0]
maxx=xl[0][1]
cnt=0
for i in range(1,N):
  if maxx<=xl[i][0]:
    maxx=xl[i][1]
  else:
    cnt+=1
print(N-cnt)
N = int(input())
robots = [tuple(map(int,input().split())) for _ in range(N)]
 
robots = [(x+l,x-l) for x,l in robots]
 
robots.sort()
 
cnt = 0
last = -float('inf')
for r,l in robots:
    if last <= l:
        cnt += 1
        last = r
 
print(cnt)
def main():
    N = int(input())
    P = [None] * N
    for i in range(N):
        X, L = map(int, input().split())
        l, r = X-L, X+L
        P[i] = (l, r)
    P.sort(key=lambda x: x[1])
    ans = 0
    lbound = -float("inf")
    for l, r in P:
        if l < lbound:
            continue
        ans += 1
        lbound = r
    print(ans)


if __name__ == "__main__":
    main()
from sys import maxsize
N = int(input())
arms = []
for i in range(N):
    x, l = map(int, input().split())
    arms.append((x-l, x+l))

arms.sort(key=lambda x: x[1])

end = -maxsize

res = 0

for arm in arms:
    if end <= arm[0]:
        res += 1
        end = arm[1]
print(res)
N=int(input())
xl=[]
for _ in range(N):
    x,l=map(int,input().split())
    xl.append([x+l,2*l])
xl.sort()
r=-10**9
ans=0

for i in range(N):
    if xl[i][0]-xl[i][1]>=r:
        ans+=1
        r=xl[i][0]

print(ans)
N = int(input())
X = [0]*N
L = [0]*N
Y = []

for i in range(N):
    X, L = map(int, input().split())
    Y.append([X+L, X-L])

Y.sort()

count = 0
length = -10**10
for i in range(N):
    if Y[i][1] >= length:
        count += 1
        length = Y[i][0]

print(count)
N = int(input())
XL = []
for i in range(N):
    xl = list(map(int, input().split()))
    XL.append(xl)

SE = []
for x, l in XL:
    s = x - l
    e = x + l
    SE.append([s, e])

SE.sort(key=lambda x:x[1])
# print(SE)

cnt = 1
st = SE[0][1]
for s, e in SE[1:]:
    if st <= s:
        cnt += 1
        st = e
print(cnt)
rl = []
N = int(input())
for i in range(N):
    x, l = map(int, input().split())
    rl.append((x+l, x-l))
rl.sort()

ans = 0
tmp = rl[0][0]
for i in range(N):
    if i and rl[i][1] < tmp:
        continue
    tmp = rl[i][0]
    ans += 1
print(ans)
n=int(input())
arms=[]
for _ in range(n):
    x,l=map(int,input().split())
    arms.append([x-l,x+l])
arms.sort()
now=arms[0][1]
cnt=0
for arm in arms[1:]:
    if now<=arm[0]:
        now=arm[1]
    elif now<=arm[1]:
        cnt+=1
    else:
        cnt+=1
        now=arm[1]
print(n-cnt)
n = int(input())
st = []
for i in range(n):
    x,l = map(int,input().split())
    st.append([x-l,x+l])

st.sort(key=lambda x:x[1])
t0 = st[0][1]
cnt = n
for s,t in st[1:]:
    if t0 <= s:#もし終わりが次の始まりより早かったら
        t0 = t
    else:
        cnt -=1
print(cnt)
N=int(input())
ES = []
for i in range(N):
    x,l = list(map(int,input().split()))
    ES.append((x+l,x-l+1))
 
ES = sorted(ES)
# print(ES)

sel = []
cur = None
ans = 0
for E,S in ES:
    if cur is None or cur < S:
        sel.append((S,E))
        cur = E
        ans += 1
print(ans)
n = int(input())
lst = []
for _ in range(n):
    x, l = map(int, input().split())
    lst.append([x-l, x+l])

lst.sort(key=lambda x:x[1])

ans = 0
st = lst[0][0]
for _ in lst:
    if st <= _[0]:
        st = _[1]
        ans += 1
print(ans)
N = int(input())
#key:いる位置, value:右手の位置
range_dct = {}
for i in range(N):
    x, l = map(int, input().split())
    range_dct[x] = x + l

range_dct_sorted = sorted(range_dct.items(), key=lambda x:x[1])

counter = 0
right = -100000000000

for key, value in range_dct_sorted:
    if right <= key * 2 - value:
        right = value
        counter += 1

print(counter)
n = int(input())
xl = [list(map(int,input().split())) for i in range(n)]
xl = sorted(xl)

pre = 0
cnt = 0
for x, l in xl:
    if pre == 0:
        pre = x + l
        continue

    if x - l < pre <= x + l:
        cnt += 1
    elif x + l < pre:
        cnt += 1
        pre = x + l
    else:
        pre = x + l

print(n - cnt)
from operator import itemgetter
n=int(input())
xl=[list(map(int,input().split()))for i in range(n)]
R=[(xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]) for i in range(n)]
r=sorted([(R[i][0],R[i][1]) for i in range(n)],key=itemgetter(1))
s=r[0][1]
ans=1
for i in range(n-1):
    if r[i+1][0]>=s:
        s=r[i+1][1]
        ans+=1
print(ans)
n = int(input())
ss = []
for i in range(n):
    x, l = map(int, input().split())
    start = max(0, x-l)
    stop = min(10**9, x + l)
    ss.append([start, stop])

sorted_ss = sorted(ss, key=lambda x: x[1])
ans = 0
t = 0

for i in range(n):
    if t <= sorted_ss[i][0]:
        ans += 1
        t = sorted_ss[i][1]
print(ans)
#!/usr/bin/env python3
import sys
import collections

sys.setrecursionlimit(10 ** 7)

# 1 ✕ 1 (int)
N = int(input().rstrip())

# N ✕ M
A = list(tuple(map(int, input().rstrip().split())) for _ in range(N))

array = []
for s, t in A:
    array.append((s + t, s - t))

array.sort()
# print(array)

ans = 0
t = -1e9
for e, s in array:
    if t <= s:
        t = e
        ans += 1

print(ans)
N = int(input())
segment = []

for _ in range(N):
    x, l = map(int, input().split())
    segment.append([max(0, x-l), x+l])

segment.sort(key=lambda seg: seg[1])

ans = 0
curr_time = -1

for i in range(N):
    if curr_time < segment[i][0]:
        curr_time = segment[i][1] - 1
        ans += 1

print(ans)
n = int(input())

Robo = []
for i in range(n):
    x, l = map(int, input().split())
    Robo.append([x-l, x+l])
Robo.sort(key=lambda x: x[1])

#print(Robo)
biggest_right = 2 * -10**9 - 1
counter = 0
for left, right in Robo:
    if biggest_right <= left:
        counter += 1
        biggest_right = max(right, biggest_right)
print(counter)
n = int(input())
position = []

for i in range(n):
	x_in, l_in = map(int, input().split())
	position.append([x_in + l_in, x_in - l_in])

position.sort()
ans = 0
t = - (10 ** 9 + 1)

for i in range(n):
	if t <= position[i][1]:
		ans += 1
		t = position[i][0]

print(ans)
N=int(input())
xl=[list(map(int,input().split()))for _ in range(N)]
rl=[[x+l,x-l]for x,l in xl]
rl.sort()
now=-10**9
ans=0
for r,l in rl:
    if l>=now:
        ans+=1
        now=r
print(ans)
import heapq
N = int(input())
robo = list(list(map(int,input().split()))for _ in range(N))
robo.sort(key=lambda x:x[0])
queue = []
for x,l in robo:
    heapq.heappush(queue,[x+l,x-l])
ans = 0
left = -float('inf')
while queue:
    q = heapq.heappop(queue)
    if q[1] >= left:
        left = q[0]
        ans += 1
print(ans)
import math , sys
N = int( input() )

X = []
for i in range(N):
    A , B = list(map(int, input().split()))
    X.append([i , A-B , A , A+B])


X.sort(key=lambda x: x[3])

Y = X[0]
Ri = Y[-1]
ans = 1

j=0

for i in range(1,N):
    Y = X[i]
    if Y[1] >= Ri:
        ans+=1
        Ri = Y[-1]
print(ans)
N = int(input())
XL = [tuple(map(int, input().split())) for i in range(N)]

XL.sort(key=lambda x: x[0])

hold = [XL[0]]

ans = 1
for i in range(1, N):
    if hold[-1][0] + hold[-1][1] > XL[i][0] - XL[i][1]:
        if hold[-1][0] + hold[-1][1] < XL[i][0] + XL[i][1]:
            continue
        else:
            hold.append(XL[i])
    else:
        ans += 1
        hold.append(XL[i])

print(ans)
n = int(input())
k_list = []

for i in range(n):
    x, l = map(int, input().split())
    k_list.append([x-l, x+l])

k_list.sort(key=lambda x: x[1])

ptr = - 10 ** 10
cnt = 0

for item in k_list:
    if item[0] >= ptr:
        ptr = item[1]
        cnt += 1

print(cnt)
n = int(input())

xl = []
tt = 10**9
for i in range(n):
    x,l = map(int, input().split())
    xl.append([x+l,x-l])
    tt = min(tt,x-l)

xl.sort()

ans = 0

for i in range(n):
  if tt <= xl[i][1]:
    ans += 1
    tt = xl[i][0]
print(ans)
N = int(input())
X = []
L = []
for i in range(N):
    x, l = map(int, input().split())
    X.append(x)
    L.append(l)

# できるだけ少ないロボットを取り除いて条件を満たすようにしたい
ranges = [[x - l, x + l] for x, l in zip(X, L)]
ranges = sorted(ranges, key=lambda x:x[1])

ans = N
for i in range(1, N):
    if ranges[i][0] < ranges[i - 1][1]:
        ranges[i][1] = ranges[i - 1][1]
        ans -= 1
print(ans)
n = int(input())
scope = []
for _ in range(n):
    x, l = map(int, input().split())
    scope.append([x+l, x-l])
    
scope.sort()
ans = 1
border = scope[0][0]
for i, r in enumerate(scope[1:]):
    if border <= r[1]:
        ans += 1
        border = r[0]
print(ans)
N = int(input())
l = [list(map(int,input().split())) for _ in range(N)]

ans = N
for i in l:
    x = 0 if i[0]-i[1] < 0 else i[0]-i[1]
    i[1] = i[0]+i[1]
    i[0] = x
    
l.sort(key=lambda x:x[1])

right = 0
for i in range(N):
    if right > l[i][0]:
        ans-=1
    else:
        right = l[i][1]

print(ans)
from operator import itemgetter


n = int(input())
info = [list(map(int, input().split())) for i in range(n)]

li = []
for i in range(n):
    x, l = info[i]
    li.append((x - l, x + l))
li = sorted(li, key = itemgetter(1))

r_max = - 10**18
ans = 0
for i in range(n):
    l, r = li[i]
    if r_max <= l:
        ans += 1
        r_max = r
print(ans)
import sys
import math
sys.setrecursionlimit(1000000000)
 
def solve(robots):
    total = len(robots)
    prev = None
    for current in robots:
        if prev and prev[0] + prev[1] > current[0] - current[1]:
            total -= 1
        else:
            prev = current
            
    return total
 
N, = map(int, input().split())
ROBOTS = [list(map(int, input().split())) for _ in range(N)]
ROBOTS = sorted(ROBOTS, key=lambda x: x[0] + x[1])
print(solve(ROBOTS))
n = int(input())

robot_list = []

for i in range(n):
    x, l = list(map(int, input().split()))
    robot_list.append([x+l, x-l, l])

delete_robot = 0
robot_list.sort()
temp_robot = robot_list[0]

for i in range(n-1):
    if temp_robot[0] > robot_list[i+1][1]:
        delete_robot += 1
    else:
        temp_robot = robot_list[i+1]

print(n - delete_robot)
N = int(input())

R = []

for i in range(N):
    x, l = map(int, input().split())
    R.append((x-l,x+l))

R_sorted = sorted(R, key=lambda x:x[1])

ans = 0
right = -10**9 - 1
i = 0
while(i < N):
    left = R_sorted[i][0]
    if left >= right:
        ans += 1
        right = R_sorted[i][1]
    i += 1

print(ans)
from collections import namedtuple


def solve(arms):
    arms = sorted(arms, key=lambda x: x.right)
    right = -float("inf")
    res = 0
    for arm in arms:
        if right <= arm.left:
            res += 1
            right = arm.right

    return res


Arm = namedtuple("Arm", ["center", "left", "right"])


arms = []
N = int(input())
for _ in range(N):
    x, length = [int(val) for val in input().split(" ")]
    arm = Arm(x, x - length, x + length)
    arms.append(arm)


ans = solve(arms)
print(ans)
N=int(input())
rang=[]
for _ in range(N):
  x,l=map(int,input().split())
  rang.append((x-l, x+l))
rang=sorted(rang, key=lambda x: x[1])
lastright=rang[0][1]
cnt=1
for i in range(1,N):
  left=rang[i][0]
  right=rang[i][1]
  if left>=lastright:
    cnt+=1
    lastright=right
print(cnt)
n=int(input())
ls=[list(map(int,input().split())) for i in range(n)]
ls.sort()

first_robot=ls.pop(0)
prev_right=first_robot[0]+first_robot[1]

for robot in ls:
    left=robot[0]-robot[1]
    right=robot[0]+robot[1]
    if left<prev_right:
        n-=1
        if right<prev_right:
            prev_right=right
    else:
        prev_right=right
print(n)
N = int(input())
l = []
for i in range(N):
  X, L = map(int, input().split())
  l.append([X-L, X+L])
  
l.sort(key=lambda x: x[1])
pin = l[0][1]
ans = 1

for i in range(1, N):
  if pin <= l[i][0]:
    ans += 1
    pin = l[i][1]
    
print(ans)
import sys
input = sys.stdin.readline

N = int(input())
imo = []
xlmin = 0
xlmax = 0
for _ in range(N):
    x,l = map(int,input().split())
    imo.append([x-l,x+l-1])
imo = sorted(imo,key = lambda x: x[1])
cnt = 1
ls = imo[0][1]
for i in range(1,N):
    if imo[i][0]<=ls:
        continue
    else:
        cnt += 1
        ls = imo[i][1]
print(cnt)