peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
A,B=map(int,input().split())
if A>=13:
    print(B)
elif A<=5:
    print(0)
else:
    print(B//2)
# Judge status: Accepted
S = input()

ans = 0

if len(S) % 2 == 1:
  n = int((len(S)-1) / 2)
else:
  n = int(len(S)/2)

for i in range(n):
  if S[i] != S[-(i+1)]:
    ans += 1

print(ans)
# Judge status: Accepted
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        AB = [tuple(map(int, input().split())) for _ in range(N)]

        AB.sort(key=lambda x: x[1])
        total_time = 0
        for a, b in AB:
            total_time += a
            if total_time > b:
                print("No")
                exit()
        print("Yes")


# Run main
if __name__ == '__main__':
    AtCoder().main()
# Judge status: Accepted
S = str(input())
 
if S[0] == S[1] == S[2]:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
N = int(input())
count = 0
for i in range(26):
    for j in range(16):
        if 4 * i + 7 * j == N:
            count +=1
print(count)
# Judge status: Accepted
k = int(input())
s = input()

if len(s) <= k:
    print(s)
else:
    print('{}...'.format(s[:k]))
# Judge status: Wrong Answer
S = list(input())
S[2] = '8'
print(S)
# Judge status: Wrong Answer
n,k = map(int,input().split())
a = list(map(int, input().split()))
b = sorted(a, key=lambda x: abs(x))[:k]
print(abs(max(b)-min(b))+min(abs(min(b)),abs(max(b))))
# Judge status: Accepted
n = int(input())
s = input()
ans = "No"
if n % 2 == 0:
    ans = "Yes"
    for i in range(n // 2):
        if s[i] != s[n // 2 + i]:
            ans = "No"
            break
print(ans)
# Judge status: Wrong Answer

import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    a=2
    b=1
    num=0
    for i in range(n-1):
       num=a+b
       a,b=b,a+b
    print(num)
resolve()
# Judge status: Accepted
K, A, B = map(int, input().split())
if A >= B:
    print(K + 1)
    exit()

# A - 1 回叩いて A 枚にする
# 残り K - (A - 1) 回については，A 枚を1 円にして，B 枚のクッキーに増やすを繰り返す．
tmp = K - (A - 1)
if tmp < 0:
    print(K + 1)
    exit()
cnt = tmp // 2
amari = tmp % 2

ans = cnt * B - (cnt - 1) * A + amari
ans = max(ans, K + 1)
print(ans)
# Judge status: Accepted
x, a, b = map(int, input().split())
if -a+b<=0:print("delicious")
elif -a+b<=x:print("safe")
else:print("dangerous")
# Judge status: Accepted
for i in range(365):
  print(i % 26 + 1)
# Judge status: Accepted
s = input()

if s[len(s)-1] == 's':
    s = s + 'es'
elif s[len(s)-1] != 's':
    s = s + 's'

print(s)
# Judge status: Wrong Answer
s = input()

MAX = 0
m = 0
for i in s:
  print(m)
  if i == "A" or i == "G" or i == "C" or i == "T":
    m += 1
    MAX = max(MAX,m)
  else:
    m = 0
# Judge status: Wrong Answer
S = input()
l = [i for i in S] 
print(l)

count = 0

while len(l) > 1:
    #print(l.pop(0))
    #print(l.pop(-1))
    print(l)
    if l.pop(0) != l.pop(-1):
        count += 1
print(count)
# Judge status: Wrong Answer
import heapq
n, m = map(int, input().split())
lst = list(map(lambda x:-1*int(x), input().split()))
heapq.heapify(lst)
for i in range(m):
  heapq.heappush(lst, heapq.heappop(lst)//2)
print(-1*sum(lst))
# Judge status: Accepted
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()

A=many_int()

count=0
for i in range(0, len(A),2):
    if A[i]%2==1:
        count+=1

print(count)
# Judge status: Wrong Answer
s = input()
s_num = int(s)
len_s = len(s)
list=[0 for x in range(len_s+1)]
for i in range(len_s-1,-1,-1):
    for j in range(4,min(9,len_s-i+1)):
        if int(s[i:i+j])%2019==0:
            list[i]=list[i+j]+1
print(sum(list))
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
four = 0
odd = 0
even = 0
for a in A:
	if a % 4 == 0:
		four += 1
	elif a % 2:
		odd += 1
	else:
		even += 1
if 2 * four + 1 >= n or even == n or four >= odd:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
x = int(input())
'''
t =  1, 2, 3, 4, 5, 6,...
d+ = 1, 3, 6,10,15,21,...
x = 11のとき、
t = 5,d+ = 15より、t = 4で一回休みすればいい
-> 行き過ぎたら一回休み
'''
i = 0
d = 0
while True:
    i += 1
    d += i
    if x <= d:
        ans = i
        break
print(ans)
# Judge status: Accepted
def main():
  h, n = map(int, input().split())
  l = [list(map(int, input().split())) for i in range(n)]

  dp = [10 ** 8 + 1 for i in range(h + 10 ** 4 + 1)]
  dp[0] = 0

  for i in range(h):
    if dp[i] == 10 ** 8 + 1:
        continue
    for a, b in l:
      x = dp[i] + b
      if dp[i + a] > x:
        dp[i + a] = x

  print(min(dp[h:]))

main()
# Judge status: Accepted
A=list(map(int,input().split()))
if(sum(A)>21):
    print("bust")
else:
    print("win")
# Judge status: Accepted
s = input()
count = 0
flag = "ok"
for i in s:
    #print(i)
    count += 1
    if count % 2 == 0:
        if i == "R":
            flag = "ng"
            break
    else:
        if i == "L":
            flag = "ng"
            break
if flag == "ok":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,c = map(int,input().split())

if a + b == c or b + c == a or a + c == b:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
K,S=map(int,input().split())

if S==0:
    print("1")
elif K>=S:
    print(int(((S+1)*(S+2))/2))
else:   #K<S(S>0)
    if (S-K)<5:
        print(int((((S+1)*(S+2))/2)-3*(((S-K-1)*(S-K))/2)))
    else:
        print(int((((S+1)*(S+2))/2)-3*10-(S-K-3)*12))
# Judge status: Wrong Answer
a = list(map(int,input().split()))
a_1,a_2 = [],[]
a_1.append(a[0])
a_1.append(a[1])
a_2.append(a[2])
a_2.append(a[3])

print(a_1,a_2)
max_a = -(10**30)
for i in a_1:
    for l in a_2:
        if(i*l > max_a):
            max_a = i*l

print(max_a)
# Judge status: Wrong Answer
def manhattan(u, v):
  return abs(u[0]-v[0])+abs(u[1]-v[1])

N, M = map(int, input().split())
ns = [list(map(int, input().split())) for _ in range(N)]
ms = [list(map(int, input().split())) for _ in range(M)]

for n in ns:
  dmin = 200000005
  num = -1
  for i, m in enumerate(ms):
    d = manhattan(n, m)
    if d < dmin:
      dmin = d
      num = i
  print(num+1)
# Judge status: Accepted
import math
n = int(input())
a = [0]*n
b = [0]*n
for i in range(n):
  a[i], b[i] = list(map(int, input().split()))
a.sort()
b.sort()
ans = 0
h = int(n/2)
if n % 2 == 0:
  a_harf = a[h-1] + a[h]
  b_harf = b[h-1] + b[h]
  ans = b_harf - a_harf + 1
else:
  ans = b[h] - a[h] + 1
  
print(ans)
# Judge status: Wrong Answer
n, k = input().strip().split()
n, k = [int(n), int(k)]

p = list(map(int, input().strip().split()))

p.sort

print(f'{sum(p[0:k])}')
# Judge status: Accepted
n = int(input())

n = n%1000
if n==0:
  print(0)
else:
  print(1000-n)
# Judge status: Accepted
import sys
n = int(input())
l = list(map(int,input().split()))
maxs=l[0]
for i in range(1,n):
    if l[i]<maxs-1:
        print("No")
        sys.exit()
    elif l[i]>=maxs:
        maxs=l[i]
    
print("Yes")
# Judge status: Accepted
K, X = map(int,input().split())
min = X - K + 1
max = X + K
print(*list(range(min,max)))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a<b:
    ans='a'*b
else:
    ans='b'*a
# Judge status: Accepted
N=int(input())
S=input()
acc=S.count(".")
ans=acc
for i in range(N):
    if S[i]=="#":
        acc+=1
    else:
        acc-=1
    ans=min(ans, acc)
print(ans)
# Judge status: Accepted
x = input()

ans = 0
stock = 0

for i in range(len(x)):
    if x[i] == 'S':
        stock += 1
    elif stock > 0:
        stock -= 1
    else:
        ans += 1

print(ans+stock)
# Judge status: Accepted
import math
a,b,x = map(int,input().split())

if x >= 0.5 * (a**2) *b:
    print(math.degrees(math.atan(2*b/a - 2*x/(a**3))))
else:
    print(math.degrees(math.atan((a*b**2)/(2*x))))
# Judge status: Accepted
S = input()
ans = 0
for i in range(len(S)):
    a = i
    k = 0
    while S[a] == 'A' or S[a] == 'C' or S[a] == 'G' or S[a] == 'T':
        k += 1
        a += 1
        if a == len(S):
            break
    ans = max(ans,k)
print(ans)
# Judge status: Accepted
n=int(input())
L = list(map(int, input().split()))
if max(L) < sum(L)-max(L):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = int(input())

A=[]
for i in range(N):
    A.append(int(input()))

B = []
for i in range(2**N):
    gokei = 0
    for j in range(N):
        if ((i >> j) & 1):
            gokei += A[j]
    B.append(gokei)

B.sort(reverse=True)
print(B)

for i in B:
    if i%10 != 0:
        print(i)
        break
# Judge status: Wrong Answer
def maxvolume (s): 
    maxvalue = 0
    i = 1
    for i in range(s - 1): 
        j = 1
        for j in range(s): 
            k = s - i - j 
            maxvalue = max(maxvalue, i * j * k) 
              
    return float(maxvalue) 
      
s = int(input())
print(maxvolume(s))
# Judge status: Wrong Answer
P = list(map(int, input().split()))
R = [[P[0]/0.25,P[0],0.25],[P[1]/0.5,P[1],0.5],[P[2],P[2],1],[P[3]/2,P[3],2]]
R.sort()
N = int(input())
d = N//R[0][2]
s = (N-R[0][2]*d)//R[1][2]
h = (N-R[0][2]*d-R[1][2]*s)//R[2][2]
q = (N-R[0][2]*d-R[1][2]*s-R[2][2]*h)//R[3][2]
ans = int(R[3][1]*q+R[2][1]*h+R[1][1]*s+R[0][1]*d)
print(ans)
# Judge status: Accepted
import math
N=int(input())
def hantei(u):
  if u==1:
    return 1
  for i in range(1,u+1):
    if (1/2)*i**2+(1/2)*i>u:
      return int(i-1)
    else:
      continue
   
a=[0]*int(math.sqrt(N))
for i in range(2,int(math.sqrt(N))+1):
  while N%i==0:
    N=N//i
    a[i-1]=a[i-1]+1
c=0
if N!=1:
  c+=1
for t in range(len(a)):
  if a[t]!=0:
    c+=hantei(a[t])
print(c)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

B = sorted(A)

median_a = B[n//2 - 1]
median_b = B[n//2]
# print(median_a, median_b)

for i in A:
    if i <= median_a:
        print(median_b)
    else:
        print(median_a)
# Judge status: Accepted
X, K, D = map(int, input().split())
X = abs(X)

if X > K * D:
  print(X - K * D)
else:
  if K % 2 == 1:
    X -= D
  print(min(X % (2 * D) , (D * 2) - X % (D * 2)))
# Judge status: Wrong Answer
N = int(input())
 
A=list(map(int, input().split()))
B=list(map(int, input().split()))
C=list(map(int, input().split()))

sum=0
for i in range(N):
  sum=sum+B[A[i]-1]
  #print(sum)
  
for i in range(N-1):
  if A[i]+1== A[i+1]:
    sum=sum+C[i-1]
  
print(sum)
# Judge status: Accepted
n, *a = map(int, open(0).read().split())
a = sorted(a)[::-1]
print(sum(a[0::2]) - sum(a[1::2]))
# Judge status: Accepted
a, b, c, d = map(int, input().split())

print(max(a*d, b*c, b*d, a*c))
# Judge status: Accepted
from collections import deque
from bisect import bisect_left
n = int(input())
a = [int(input()) for _ in range(n)]
ans = deque([a[0]])
for a_i in a[1:]:
    if ans[0] < a_i:
        i = bisect_left(ans, a_i)
        ans[i-1] = a_i
    else:
        ans.appendleft(a_i)

print(len(ans))
# Judge status: Wrong Answer
s = input()
now = []
for i in range(len(s)):
    if s[i] == "0":
        now.append("0")
    elif s[i] == "1":
        now.append("1")
    elif s[i] == "B":
        if len(now) == 0:
            continue
        else:
            now.remove(now[-1])
ans = ""
for i in range(len(now)):
    ans += now[i]
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
list_ab = []
for i in range(n):
    ab = list(map(int, input().split()))
    list_ab.append(ab)
cnt = 0
b_sum = 0
list_ab.sort()

for j in list_ab:
    if b_sum < k:
        b_sum += j[1]
        cnt += 1
    else:
        break

print(list_ab[cnt-1][0])
# Judge status: Wrong Answer
A, B = map(float, input().split())
mul = A * B
print(int(mul))
# Judge status: Wrong Answer
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())


n = inint()
A = inintl()

A = sorted(A)[::-1]

for i in range(n-3):
    if A[i] != A[i+1] or A[i+2] != A[i+3]:
        continue
    else:
        print(A[i]*A[i+2])
        exit()

print(0)
# Judge status: Wrong Answer
N,M,X,Y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
for i in range(X+1,Y):
  if max(xl) < i and min(yl) >= i:
    print("NoWar")
    exit()
print("War")
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
ans = 0

A = [-1 * i for i in A]
heapq.heapify(A)

for i in range(M):
    fst = heapq.heappop(A)
    fst = int(fst / 2)
    heapq.heappush(A, fst)
    
ans = -1 * sum(A)
print(ans)
# Judge status: Accepted
a,b,c=map(int, input().split())
print("YES" if a-b==b-c else "NO")
# Judge status: Accepted

ans=0
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    if (i+1) % 2 == 0:
        continue
    if a[i]%2!=0:
        ans+=1
print(ans)
# Judge status: Accepted
# D - Knight

MOD = 10 ** 9 + 7
x, y = map(int, input().split())

n, r1 = divmod(2 * y - x, 3)
m, r2 = divmod(2 * x - y, 3)

def com(n, r):
    X = Y = 1
    if r < 0 or n < r:
        return 0
    if n - r < r:
        r = n - r
    for i in range(1, r + 1):
        Y = Y * i % MOD
        X = X * (n - i + 1) % MOD
    Y = pow(Y, MOD - 2, MOD)
    return X * Y

if r1 != 0 or r2 != 0:
    print(0)
else:
    print(com(n + m, n) % MOD)
# Judge status: Wrong Answer
L = int(input())

if L%3==0:
  h = L//3
  print(h**3)
elif L%3==1:
  h = L//3
  print(h*h*(h+1))
elif L%3==2:
  h = L//3
  print(h*(h+1)*(h+1))
# Judge status: Accepted
N,M=map(int,input().split())
if N==1:
    if M==1:
        print(1)
    else:
        print(M-2)
elif M==1:
    print(N-2)
else:
    print((N-2)*(M-2))
# Judge status: Wrong Answer
import sys
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
if n==1:
  ANS=S[0]
  ANS.sort()
  ans="".join(ANS) 
  print(ans)
  sys.exit()
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
for i in ANS:
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    else:
      ANS.remove(i)
      break
ANS.sort()      
ans="".join(ANS)  
print(ans)
# Judge status: Accepted
def main():
    a, b, c = map(int, input().split())
    l = sorted([a, b, c])
    i, j, k = l[0], l[1], l[2]
    if k % 2 == 0:
        print(0)
    else:
        print(i * j)


if __name__ == '__main__':
    main()
# Judge status: Accepted
# A
import math
A_B_C = list(map(int,input().split()))

if A_B_C[0] % 2 == 0 or A_B_C[1] % 2 == 0 or A_B_C[2] % 2 == 0:
  print(0)
else:
  max_v = max(A_B_C)
  max_i = A_B_C.index(max_v)
  ans = 1
  for i in range(len(A_B_C)):
    if max_i == i:
      ans *= (math.ceil(max_v/2) - math.floor(max_v/2))
    else:
      ans *= A_B_C[i]
    
  print(ans)
# Judge status: Accepted
X, A, B = map(int,input().split())
L = A + X
if A >= B:
  print("delicious")
elif B <= L:
  print("safe")
else:
  print("dangerous")
# Judge status: Wrong Answer
N, M = map(int, input().split())

if N == 1:
    if M == 1:
        print(1)
    else:
        print((N-2)*(M-2)*(-1))
else:
    print((N-2)*(M-2))
# Judge status: Accepted
import collections

N = int(input())
S = input()

d = collections.Counter(S)
ans = 1
for key in d:
  ans = ans * (d[key] + 1)
print((ans-1) % (10**9 +7))
# Judge status: Accepted
x,y = map(int,input().split())

grp1=[1,3,5,7,8,10,12]
grp2=[4,6,9,11]

if x in grp1 and y in grp1: print('Yes')
elif x in grp2 and y in grp2: print('Yes')
else: print('No')
# Judge status: Accepted
n=int(input())
w=list(map(int,input().split()))
print(min([abs(sum(w[:i])-sum(w[i:])) for i in range(len(w))]))
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())

x = tx - sx
y = ty - sy

ret = ''

#first
ret += 'U' * y
ret += 'R' * x
ret += 'D' * y
ret += 'L' * x

#second
ret += 'L'

ret += 'U' * (y + 1)
ret += 'R' * (x + 1)

ret += 'DR'

ret += 'D' * (y + 1)
ret += 'L' * (x + 1)

ret += 'U'

print(ret)
# Judge status: Wrong Answer
import numpy as np
h,n=map(int,input().split())
a=np.empty((3,n))
for i in range(n):
  aa,bb=map(int,input().split())
  a[0,i]=aa
  a[1,i]=bb
  a[2,i]=aa/bb
a=a[:,np.argsort(a[0,:])[::-1]]
c=0
while h>0:
  for i in range(n):
    if a[0,i]<h or a[0,i]==a[0].min():
    	h-=a[1,i]
    	c+=a[0,i]
    	break
print(int(c))
# Judge status: Accepted
(n, m), *q = [[*map(int, i.split())] for i in open(0)]
b = [0] * (n + 1)
b[1] = 1
c = [1] * (n + 1)
for x, y in q:
    c[x] -= 1
    c[y] += 1
    b[y] |= b[x]
    b[x] *= c[x] > 0
print(sum(b))
# Judge status: Accepted
S = input()

while len(S) > 0:
  if (len(S) >= 5):
    if (S[-5:] == 'dream' or S[-5:] == 'erase'):
      S = S[:-5]
      continue
  if (len(S) >= 6):
    if (S[-6:] == 'eraser'):
      S = S[:-6]
      continue
  if (len(S) >= 7):
    if (S[-7:] == 'dreamer'):
      S = S[:-7]
      continue
  break
if (len(S) == 0):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
import sys
import math

input = sys.stdin.readline

N, K = map(int, input().split())
ans = 0
for i in range(1, N+1):
    if i >= K:
        ans += 1 / N
    else:
        ans += 1/(N*2**math.ceil(math.log2(K/i)))
print(ans)
# Judge status: Accepted
S = list(input())
K = int(input())
for i in range(min(len(S),K)):
    if S[i] != "1":
        print(int(S[i]))
        exit()
print(1)
# Judge status: Accepted
print('No' if int(input().replace(' ',''))**0.5%1 else 'Yes')
# Judge status: Wrong Answer
n,x,y = map(int, input().split())

for i in range(1, n):
  s = 0
  for a in range(1, n):
    for b in range(a, n+1):
      if n < b:
        break
      #print(a,b)
      if a <= x and y <= b:
        if b-a-1 == i:
          s += 1  
      elif b-a == i:
        s += 1
  print(s)
# Judge status: Accepted
int1 = lambda x: int(x) - 1
N, A, B, C, D = map(int1, input().split())
S = input()

if "##" not in S[A:B+1] and "##" not in S[C:D+1]:
    if C > D and "..." not in S[B-1:D+2]:
        print("No")
    else:
        print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b = map(int, input().split())

res = a*b
if res % 2 == 0:
  print('Even')
else:
  print('Odd')
# Judge status: Accepted
n, k = map(int, input().split())
l = list(map(int, input().split()))
if sum(l) == len(l):
  print(0)
elif n==k:
  print(1)
else:
  print((n-1+k-2)//(k-1))
# Judge status: Accepted
# -*- coding: utf-8 -*-
# C

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

mod = 10**9 + 7
n = int(input())

ans = pow(10,n,mod)
ans -= pow(9,n,mod)
ans -= pow(9,n,mod)
ans += pow(8,n,mod)

print(ans % mod)
# Judge status: Accepted
def main():
    N = int(input())
    trains = [list(map(int, input().split(' '))) for _ in range(N - 1)]
    ans = [0 for _ in range(N)]
    for i in range(N - 1):
        t = 0
        for train in trains[i:]:
            c, s, f = train
            wait_time = s - t if t <= s else (f - t) % f
            t += wait_time + c
        ans[i] = t
    for a in ans:
        print(a)


if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()
K = int(input())

i = 0
while i<len(S) and S[i]=='1':
    i += 1

if i >= K:
    print(1)
else:
    print(S[i])
# Judge status: Accepted
S=input()
T=S[:(len(S)-1)//2]
U=S[(len(S)+3)//2-1:]
if S==S[::-1]:
    if T==T[::-1]:
        if U==U[::-1]:
            print('Yes')
        else:print('No')
    else:print('No')
else:print('No')
# Judge status: Wrong Answer
def main():
    t = list(map(int, input().split()))
    print(t[1] + t[2] - t[0])

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()
T = input()
ans = 0
for i in range(len(S)):
  if S[i] != T[i]:
    ans += 1
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().strip().split()))
A = sorted(A)

if N == 1:
    print(0)
else:
    print(sum(A[1:]))
# Judge status: Accepted
N = int(input())
xl = [list(map(int, input().split())) for _ in range(N)]

xl.sort()

ans = N
rpre = xl[0][0] + xl[0][1]

for x, l in xl[1:]:
    ll = max(x - l, 0)
    rr = x + l
    if ll < rpre:
        ans -= 1
        if rr < rpre: rpre = rr
    else:
        rpre = rr

print(ans)
# Judge status: Wrong Answer
A, B = map(int, input().split())

while A==B:
  if A < B:
    A += A
  else:
    B += B

print(A)
# Judge status: Accepted
n=int(input())
cnt=[[0]*10 for i in range(10)]
for i in range(1,n+1):
  s=str(i)
  h=int(s[0])
  t=int(s[-1])
  cnt[h][t]+=1
ans=0
for i in range(10):
  for j in range(10):
    ans+=cnt[i][j]*cnt[j][i]
print(ans)
# Judge status: Wrong Answer
def luka(i):
    if i==0:
        return 2
    if i==1:
        return 1
    return luka(i-1)+luka(i-2)

print(luka(5))
# Judge status: Wrong Answer
import heapq
N,M=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x * (-1), a))  # 各要素を-1倍
heapq.heapify(a)  # リストを優先度付きキューへ
for _ in range(M):
    number=heapq.heappop(a)  # 最大値の取り出し
    heapq.heappush(a, number//2+1)  # 要素の挿入
print(-sum(a))
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

for i in range(1,N-K+1):
    if (A[K-1+i] / A[i-1]) > 1:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
all_vote = sum(A)
count = 0


for i in range(N):
    if  A[i] >= all_vote / (4*M):
        count += 1

if count < M:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
k = int(input())

dist_string = input()
l = dist_string.split()
a = int(l[0])
b = int(l[1])

counter = 0

for number in range(a,b+1):
    if number % k == 0:
        print("OK")
        counter += 1
        break

if counter == 0:
    print("NG")
# Judge status: Accepted
h, k = map(int, input().split())
h = list(map(int, input().split()))

print(sum(sorted(h, reverse=True)[k:]))
# Judge status: Accepted
A = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7-A.index(input()))
# Judge status: Accepted
n,m = map(int,input().split())
if n == 1 and m == 1:
	print(1)
elif n == 1:
	print(m-2)
elif m == 1:
	print(n-2)
else:
	print((n-2)*(m-2))
# Judge status: Accepted
import math
n, m = map(int, input().split())

mod = (10 ** 9) + 7
if abs(n - m) >= 2:
    print("0")
else:
    nn = math.factorial(n)
    mm = math.factorial(m)
    if abs(n - m) >= 1:
        print((nn * mm) % mod)
    else:
        ans = nn * 2 % mod
        ans = ans * mm % mod
        print(ans)
# Judge status: Accepted
N = int(input())

alp = "abcdefghijklmnopqrstuvwxyz"
answer = ""

while N != 0:
  N -= 1
  index = N % 26
  answer += alp[index]
  N = N // 26
  
print(answer[::-1])
# Judge status: Accepted
x = input().split()
a = int(x[0])
b = int(x[1])
c = int(x[2])
d = (a + b) - c
if d >= 0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
x, k, d = list(map(int, input().split()))

minimum = x - d * k
maximum = x + d * k

if minimum >= 0:
    print(minimum)
elif maximum <= 0:
    print(-maximum)
else:
    c1 = maximum % (2*d)
    c2 = c1 - 2*d
    print(min(abs(c1), abs(c2)))
# Judge status: Wrong Answer
import fractions
A, B, C, D = map(int, input().split())
if B > C:
    n_C = int(B / C) - int((A-1) /C)
else:
    n_C = 0
if B > D:
    n_D = int(B / D) - int((A-1) /D)
else:
    n_D = 0
n = C * D // fractions.gcd(C, D)
if B > n:
    n_C_D = int(B / n) - int((A-1)/n)
else:
    n_C_D = 0
print(B-A-n_C-n_D+n_C_D+1)
# Judge status: Accepted
s = input()
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
aa = [0]*26
ans = "yes"
for i in range(len(s)):
    for j in range(26):
        if s[i] == alphabet[j]:
            aa[j] += 1
            if aa[j] >= 2:
                ans = "no"
                break
print(ans)
# Judge status: Accepted
# coding: utf-8
# Your code here!

n = input()

ans = "No"
for i in n:
    if i == "7":
        ans = "Yes"
        
print(ans)
# Judge status: Wrong Answer
N = int(input())
X = list(map(int, input().split()))

hp_sums = []

for i in range(max(X)):
    P = i+1
    distance_list = list(map(lambda x: (x-P)**2, X))
    print(distance_list)
    hp_sum = sum(distance_list)
    hp_sums.append(hp_sum)

print(min(hp_sums))
# Judge status: Accepted
N, D = map(int, input().split())
count = 0
for n in range(N):
    X, Y = map(int, input().split())
    if((D ** 2) >= ((X ** 2) + (Y ** 2))):
        count += 1
print(count)