peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def main():
    n,a,b = map(int,input().split())
    MOD = 10**9 +7
    s = pow(2,n,MOD)-1
    
    print(comb_mod(n,MOD,a,b,s))

def comb_mod(n, mod,a,b,s):
    numerator = 1
    denominator = 1
    for i in range(b):
        numerator = (numerator * (n - i)) % mod
        denominator = (denominator * (i + 1)) % mod
        if i == a-1 or i == b-1:
            s = s - (numerator * pow(denominator, mod - 2, mod)) % mod
    return s%mod


if __name__=='__main__':
    main()
# Judge status: Wrong Answer
n,k = map(int,input().split())
if(n%k==0 or n//k ==0):
  a = 0
else:
  a = 1
for i in range(100000000000):
  n =  n//k
  a +=1
  if(n==1 or n==0):
    break
print(a)
# Judge status: Wrong Answer
n = int(input())
s = input()

for i in range(len(s)):
	print(chr(ord(s[i])+n), end="")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
flag_lst = [0]*N

for i in range(N):
    for j in range(N):
        if flag_lst[j] >= 1:
            pass
        else:
            if A[j] % A[i] == 0:
                flag_lst[j] += 1

res = 0
for flag in flag_lst:
    if flag == 1:
        res += 1

print(res)
# Judge status: Accepted
k = list(map(str, input().split()))
v = list(map(int, input().split()))
u = str(input())

if u == k[0]:
  print(v[0]-1, v[1])
else:
  print(v[0], v[1]-1)
# Judge status: Accepted
from collections import defaultdict
s = input()
n, p = len(s), 2019

dd = defaultdict(int)
dd[0] = 1
prev = 0

for i in range(n-1, -1, -1):
    d = int(s[i]) * pow(10, n-i, p)
    prev = (prev + d) % p
    dd[prev] += 1

print(sum(v*(v-1)//2 for v in dd.values()))
# Judge status: Accepted
from collections import Counter
N = int(input())
N_ = int(N**0.5)+2

counter = Counter()
for x in range(1,N_):
    for y in range(1,N_):
        if N <= x**2+y**2+x*y:
            break
        for z in range(1,N_):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if N < tmp:
                break
            counter[tmp] += 1

for i in range(1,N+1):
    print(counter[i])
# Judge status: Accepted
N = int(input())
MOD = 10 ** 9 + 7

power = 1
for i in range(1, N+1):
    power *= i
    power %= MOD
print(power)
# Judge status: Accepted
N, X, T = map(int, input().split())
if N%X ==0:
    ans = (N // X ) *T
else:
    ans = (N // X +1) *T
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
AA = [0 for i in range(N)]
 
for i in range(N):
  AA[A[i]-1] = i + 1
  
L=[str(a) for a in AA]
L=" ".join(L)
print(L)
# Judge status: Wrong Answer
import heapq
N, M = map(int, input().split())
S = list()
A = [list() for _ in range(M)]
for _ in range(N):
    a, b = map(int, input().split())
    if M < a:
        continue
    heapq.heappush(A[M-a-1], -b)

ans = 0
for i in range(M):
    for num in A[i]:
        heapq.heappush(S, num)
    if S == []:
        continue
    ans -= heapq.heappop(S)
print(ans)
# Judge status: Wrong Answer
a = list(map(int,input().split()))
k = int(input())
#青＞緑＞赤
r,g,b = 0,0,0
for i,num in enumerate(a):
    if i==0:
        r = num
    elif i==1:
        g = num
    elif i==2:
        b = num

for i in range(k):
    if b<g and b*2>g:
        b *= 2
    elif g<r and g*2>r:
        g *= 2
    elif r*2<g and r*2<b:
        r*=2

if b>g and g>r:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    if a[0] %2 ==1:
        print((a[0]//2)*(a[0]//2-1))
    else:
        print((a[0]//2)*(a[0]//2))
# Judge status: Accepted
X = int(input())
flag = False
for A in range(-120, 121):
    if flag == True:
        break
    for B in range(-121, A):
        if A**5 - B**5 == X:
            flag = True
            print(A, B)
            break
# Judge status: Wrong Answer
n=int(input())
s=input()
num=len(s)
new=""
for i in range(num):
  a=ord(s[i])
  b=a+n
  if b>90:
    new+=chr(b-24)
  else:
    new+=chr(b)
print(new)
# Judge status: Accepted
import math
A, B = list(map(int, input().split()))

print(math.ceil((B -1 ) / (A - 1)))
# Judge status: Accepted
s = input()
letters = 'abcdefghijklmnopqrstuvwxyzAC'
print('AC' if s[0] == 'A' and s[2:-1].count('C') == 1 and all(c in letters for c in s) else 'WA')
# Judge status: Wrong Answer
from math import sqrt

A, B = map(int, input().split())
rootA = int(sqrt(A))
rootB = int(sqrt(B))

PrimeFactorA = []
PrimeFactorB = []
for i in range(2, rootA+1):
	while A%i == 0:
		A //= i
		PrimeFactorA.append(i)
PrimeFactorA = set(PrimeFactorA)

for i in range(2, rootB+1):
	while B%i == 0:
		B //= i
		PrimeFactorB.append(i)
PrimeFactorB = set(PrimeFactorB)

count = 1
if PrimeFactorA and PrimeFactorB:
	for a in PrimeFactorA:
		if a in PrimeFactorB:
			count += 1

print(count)
# Judge status: Accepted
from itertools import permutations
from math import sqrt
n = int(input())
town = []
for i in range(n):
    town_i = list(map(int,input().split()))
    town.append(town_i)

cnt = 0
length = 0
for j in permutations(range(n)):
    x,y = town[j[0]][0],town[j[0]][1]
    for k in range(1,n):
        length += sqrt((x-town[j[k]][0])**2+(y-town[j[k]][1])**2)
        x = town[j[k]][0]
        y = town[j[k]][1]
    cnt += 1

print(length/cnt)
# Judge status: Wrong Answer
n = int(input())
cnt = 0
a = list(map(int, input().split()))
for i in range(n):
    if(a[i] % 2 != 0):
        cnt += 1
if(cnt < n / 2):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,x,y = map(int, input().split())
l = [0]*(n+1)
for i in range(1,n+1):
    for j in range(1,i):#j<i
        a = min(i-j,abs(x-j)+abs(y-i)+1)
        l[a] += 1
        print(j,i,a)
for i in range(1,n):
    print(l[i])
# Judge status: Accepted
K=int(input())
A,B=map(int,input().split())

answer="NG"

for i in range(A,B+1):
    if i%K==0:
        answer="OK"
        break
print(answer)
# Judge status: Accepted
a, b = map(int, input().split())
c = max(a, b)
d = min(a, b)
x = a * b

while c%d != 0:
    tmp = d
    d = c%d
    c = tmp

print(x//d)
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
c = input().rstrip()
white = [0] * N
red = [0] * N
if c[0] == 'W':
    white[0] = 1
for i in range(1, N):
    white[i] = white[i-1]
    if c[i] == 'W':
        white[i] += 1
for i in range(1, N)[::-1]:
    red[i-1] = red[i]
    if c[i] == 'R':
        red[i-1] += 1
if white[-1] == 0 or red[0] == 0:
    print(0)
    exit()
for i in range(N):
    if white[i] == red[i]:
        print(white[i])
        exit()
# Judge status: Accepted
n=int(input())
ans=10e5
for a in range(1,n//2+1):
    b=n-a
    ans=min(ans,sum([int(i) for i in str(a)])+sum([int(i) for i in str(b)]))
print(int(ans))
# Judge status: Accepted
a, b = map(int, input().split())

if (a * b) % 2 == 0:
    print('Even')
else:
    print('Odd')
# Judge status: Accepted
def main():
    n,m = map(int,input().split())
    ab = sorted([list(map(int,input().split())) for _ in range(n)], key=lambda x:(x[0],x[1]))
    res = 0
    for a,b in ab:
        if m == 0:
            break
        buy = min(m,b)
        res += a*buy
        m -= buy
    print(res)

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

flag = False
for i in range(len(S)):
    s = ""
    for j in range(len(S)):
        a = (i+j)%len(S)
        s = s+S[a]
    if s==T:
        flag = True
        break
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
A = list(map(int,input().split()))
A.sort()
B = list(map(int,input().split()))
C = list(map(int,input().split()))
C.sort()

total = 0
tmp_a_t = 0
tmp_c_t = 0
from bisect import bisect_left,bisect_right
for i,b in enumerate(B):
    tmp_a = bisect_left(A,b)
    tmp_c = len(C)-bisect_right(C,b)
    print(tmp_a,tmp_c)
    total += tmp_a*tmp_c
# print(tmp_a,tmp_c_t)
# total += tmp_a*tmp_c_t
print(total)
# Judge status: Accepted
n,k=map(int,input().split())
print(-(-(n-1)//(k-1)))
# Judge status: Accepted
k = int(input())
res = int(k / 2) * int((k + 1) / 2)
print(res)
# Judge status: Accepted

s = list(input())
t = list(input())

s.sort()
t.sort(reverse = True)

if s < t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def dfs(A: list):
    if len(A) > len(str(n))+1:
        return
    if len(A) and (x := int("".join(A))) >= n and ans[0] > x:
        ans[0] = x
        return

    for v in d:
        if v == "0" and len(A) == 0:
            next
        A.append(v)
        dfs(A)
        A.pop()


n, k = map(int, input().split())
d = sorted(list(set([str(i) for i in range(10)]) - set(input().split())))
ans = [10**10]
dfs([])
print(ans[0])
# Judge status: Accepted
import itertools

n = int(input())

p = [[int(i) for i in input().split()] for i in range(n)]

def how_far(a,b):
    return ((a[0]-b[0])**2+(a[1]-b[1])**2)**0.5

p_list = list(itertools.permutations(p))

s = 0

for x in p_list:
    for y in range(n-1):
        s += how_far(x[y],x[y+1])

print(s/len(p_list))
# Judge status: Accepted
s = int(input())
x, y = (s - 1) // pow(10, 9) + 1, s % pow(10, 9)
if y == 0:
    y = pow(10, 9)
print(1, 0, 0, pow(10, 9), x, y)
# Judge status: Accepted
import math
a,b,h,m, = map(int,input().split())
al = 360*(60*h+m)/720
be = 360*m/60
x = (a**2 + b**2 - 2*a*b*math.cos(math.radians(al-be)))**(0.5)
print(x)
# Judge status: Wrong Answer
import math
N = int (input ())
l = input ().split ()
list.sort (l, reverse=True)
a = 0
x = 0
m = math.ceil(N/2)
for i in range (m):
    x += int (l[a])
    a += 2
b = 1
y = 0
for i in range (N-m):
    y += int (l[b])
    b += 2
print (x-y)
# Judge status: Accepted
A, B, C = map(int, input().split())

num = int(B / A)

if num >= C:
    print(C)
elif num >= 1:
    print(num)
else:
    print('0')
# Judge status: Wrong Answer
a, b = map(int, input().split())
ave=(a+b)/2
if ave-int(ave)==0:
    print(ave)
else:
    print(int(ave)+1)
# Judge status: Accepted
import collections

N = int(input())
S = [tuple(sorted(input())) for _ in range(N)]
c = collections.Counter(S)
ans = 0
for i in set(S):
    n = c[i]
    ans += n*(n-1)//2
print(ans)
# Judge status: Accepted
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]
bingo = False
for i in range(3):
    if (A[i][0] in B and A[i][1] in B and A[i][2] in B) or (A[0][i] in B and A[1][i] in B and A[2][i] in B):
        bingo = True
if (A[0][0] in B and A[1][1] in B and A[2][2] in B) or (A[0][2] in B and A[1][1] in B and A[2][0] in B):
    bingo = True
print("Yes" if bingo else "No")
# Judge status: Wrong Answer
n = int(input())
p = list(map(int,(input().split())))

hikaku = list(range(1,n+1))
count = 0
for i in range(n):
    if hikaku[i] != p[i]:
        count += 1
if count >3:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
n, a, b = map(int, input().split())
ans = 0
some = list()

for i in range(n + 1):
    s = str(i)
    array = list(map(int, s))
    if sum(array) >= a and sum(array) <= b:
        ans += i

print(ans)
# Judge status: Accepted
n=int(input())
a=[list(map(int,input().split())) for _ in range(n-1)]
ans=[]
for i in range(n):
    now=0
    for j in range(i,n-1):
        c,s,f=a[j]
        if s==now:
            k=0
        elif s>now:
            k=s-now
        else:
            if now%f!=0:
                k=f-now%f
            else:
                k=0
        now+=c+k
    print(now)
# Judge status: Wrong Answer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-*-

from sys import stdin


def main():
    X = int(stdin.readline())

    y500 = X // 500
    y5 = (X % 500) % 5
    print(y500 * 1000 + y5 * 5)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s = input()
ans = 0
for i in range(1,len(s)):
  tmp = s[:-i]
  l_tmp = len(tmp)
  if l_tmp %2 == 1:
    continue
  else:
    if tmp[:l_tmp//2] == tmp[l_tmp//2:]:
      ans = l_tmp
print(ans)
# Judge status: Accepted
x = int(input())
if x%11 == 0:
    print(2*x//11)
else:
    print(2 + 2*(x//11) if 6<(x%11) else 1 + 2*(x//11))
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))

Alice = 0
Bob = 0

#降順に並べることが完了
ld = sorted(a, reverse=True)

Alice = ld[:: 2]
# print(Alice)

Bob = ld[1:: 2]
# print(Bob)

Alice_a = sum(Alice)
Bob_a = sum(Bob)


print(Alice_a - Bob_a)
# Judge status: Accepted
import sys

a,b,c,d =map(int,input().split())

while a>0 or b>0:
    c -= b
    if c <=0:
        print('Yes')
        sys.exit()
    else:
        a -= d
        if a<=0:
            print('No')
            sys.exit()
# Judge status: Accepted
x, y, z = map(int, input().split())
print(z, x, y, sep=" ")
# Judge status: Accepted
import heapq

N, M = map(int, input().split()) # N個の駒、M個の地点
X = list( map(int, input().split())) #駒の座標


if N >= M:
    ans = 0
else:
    X.sort()
    distance = [0] * (M-1)
    for i in range(M-1):
        distance[i] = -abs(X[i+1] - X[i])

    sum_distance = sum(distance)
    heapq.heapify(distance)

    count = 0 
    for _ in range(N-1):
        max_num = heapq.heappop(distance)
        count += max_num

    ans = abs(sum_distance - count)

print(ans)
# Judge status: Accepted
[N,K] = list(map(int,input().split()))
if N%K==0:
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
"""
abc179_B
"""
n = int(input())
ans = 'No'

a = [input().split() for i in range(n)]

for i in range(0,n-3):
    if a[i][0]== a[i][1] and a[i+1][0] == a[i+1][1] and a[i+2][0] == a[i+2][1]:
    #if a[i,0] == a[i,1] and a[i+1,0] == a[i+1,1] and a[i+2,0] == a[i+2,0]:
        ans = 'Yes'
        break

print(ans)
# Judge status: Wrong Answer
a=list(map(int,input().split()))
a.sort()
print(a[0]+a[1]+a[2]*2)
# Judge status: Wrong Answer
N = int(input())
mini = float("inf")
for A in range(2,N-2):
  mini = min(mini,sum([int(digit) for digit in str(A)])+sum([int(digit) for digit in str(N-A)]))
print(mini)
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=[0]+list(map(int,input().split()))


b=[1]
d=set()
d.add(1)
e=1
while n==n:
  if a[e] in d:
    e=a[e]
    break
  b.append(a[e])
  d.add(a[e])
  e=a[e]
print(b[(k-b.index(e))%(len(b)-b.index(e))+b.index(e)])
# Judge status: Accepted
#!/usr/bin/env python3
import sys
n, y = map(int, input().split())

for i in range(n + 1):
    for j in range(n + 1):
        k = n - i - j
        if (k < 0) or (i + j + k != n):
            continue

        if (i * 10000) + (j * 5000) + ((k) * 1000) == y:
            print(i, j, k)
            sys.exit()

print(-1, -1, -1)
# Judge status: Accepted
l, r, d = map(int, input().split())

ans = 0
for i in range(l, r+1):
    if i%d == 0:
        ans += 1

print(ans)
# Judge status: Wrong Answer
n = int(input())
l = []
for _ in range(n):
  x,y = map(int, input().split())
  l.append([x+y,x-y])
l.sort()

temp = l[0][1]
count = n
i = 1
for i in range(1,n):
  if temp <= l[i][1]:
    pass
  else:
    temp = min(temp,l[i][1])
    count -= 1
print(count)
# Judge status: Wrong Answer
import numpy as np
N = int(input())
l = np.array(list(map(int,input().split())))
ans = 'Yes'
M = l[0]

for i in range(1,N):
    if l[i] > l[i-1]:
        M = l[i]
    print(M,l[i])

    if l[i]< M-1:
        ans ='No'
        break
print(ans)
# Judge status: Accepted
N,M,K = list(map(int, input().split()))
A=list(map(int, input().split()))
B=list(map(int, input().split()))

a,b=[0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])

ans,j=0,M
for i in range(N+1):
    if a[i]>K:
        break
    while b[j] > K-a[i]:
        j-=1
    ans=max(ans, i+j)
print(ans)
# Judge status: Accepted
n=int(input())
A=[int(i) for i in input().split()]

x=sum(A)
y=0
ans=10**16

for i in range(n-1):
    x-=A[i]
    y+=A[i]
    ans=min(ans,abs(x-y))

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

d=A
if K-A-B>0:
    d=d-(K-A-B)
print(d)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
N = int(input())

b = min(a + a, b)
c = min(b + b, c)
d = min(c + c, d)

q, r = divmod(N, 2)
x = q * d + r * c
print(x)
# Judge status: Accepted
N=int(input())
L=[]
for i in range(N-1):
    c,s,f=map(int, input().split())
    L.append((c,s,f))

for i in range(N):
    if i==N-1:
        print(0)
    now=0
    for j in range(i,N-1):
        c,s,f=L[j]
        if now<s:
            now+=s-now
        if now%f!=0:
            now+=(f-now%f)
        now+=c
        if j==N-2:
            print(now)
# Judge status: Accepted
#!/usr/bin/env python3
k, a, b = map(int, input().split())
if k < a + 1 or 2 > b - a:
    print(k + 1)
else:
    print((k - a + 1) // 2 * (b - a) + a + (k - a + 1) % 2)
# Judge status: Wrong Answer
N=int(input())
S=input()
i=0
hidari=str()
migi=str()
a=0
while i<N:
  if S[i]==")":
    hidari+="("
    i+=1
  else:
    break
while i<N:
  if S[i]=="(":
    a+=1
  else:
    a-=1
  i+=1
if a<0:
  hidari+=abs(a)*"("
elif a>0:
  migi+=a*")"
print(hidari+S+migi)
# Judge status: Wrong Answer
a, b = 2, 1
for i in range(int(input())-1):
    a, b = b, a+b
print(a)
# Judge status: Accepted
import math

n, k = map(int, input().split())
A = list(map(int, input().split()))

print(math.ceil((n-k)/(k-1)+1))
# Judge status: Wrong Answer
S = input()
W = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]

print((-1 * W.index(S)) + 6)
# Judge status: Accepted
S=input()
print(max(i for i in range(4)if S.count("R"*i)))
# Judge status: Accepted
def resolve():
    n,D = list(map(int, input().split()))
    cnt = 0
    for _ in range(n):
        x,y = list(map(int, input().split()))
        d = x*x + y*y
        if d <= D*D:
            cnt += 1
    
    print(cnt)

resolve()
# Judge status: Accepted
ｋ = int(input())
a,b = map(int,input().split())
n=0
while True:
    n+=k
    if n>=a and n<=b:
        print('OK')
        break
    if n>b:
        print('NG')
        break
# Judge status: Wrong Answer
s = str(input())
a = s.find("A")
z = s.find("Z")
print(len(s[a:z + 1]))
# Judge status: Accepted
N = int(input())
X = [int(i) for i in input().split()]
L, R = min(X), max(X)

ans = 10**1000
for i in range(L, R+1):
    box = 0
    for j in range(N):
        box += (X[j] - i)**2
    if ans > box:
        ans = box

print(ans)
# Judge status: Wrong Answer
N = int(input())

mod = 10 ** 9 + 7

ans=(10**N)%mod-(9**N)%mod-(9**N)%mod+(8**N)%mod
print(ans)
# Judge status: Accepted
def main():
    n = int(input())

    pt, px, py = 0, 0, 0
    for _ in range(n):
        t, x, y = map(int, input().split())
        dt = t - pt
        dx = abs(x - px)
        dy = abs(y - py)
        if (dx + dy) % 2 != dt % 2:
            print('No')
            return
        if (dx + dy) > dt:
            print('No')
            return
    print('Yes')


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
line=list(map(int,input().split( )))

step_sum=0
h=line[0]

for i in line:
    if i<h:
        step_sum+=h-i
    elif i>h:
        h=i
print(step_sum)
# Judge status: Accepted
from collections import Counter
N = int(input())
a = Counter(list(map(int, input().split())))

cnt = 0
for i in a.keys():
    if i > a[i]:
        cnt += a[i]
    else:
        cnt += a[i] - i
print(cnt)
# Judge status: Accepted
import math
n = int(input())
freq = [[0] * 10 for _ in range(10)]

for i in range(1, n+1):
  a = int(str(i)[0])
  b = int(str(i)[-1])
  freq[a][b] += 1

ans = 0
for j in range(1, n+1):
  a = int(str(j)[0])
  b = int(str(j)[-1])
  ans += freq[b][a]

print(ans)
# Judge status: Accepted
n = int(input())
a = input().split()
b = []
for i in range(n - 1, -1, -2):
  b.extend([a[i]])
for j in range(n % 2, n, 2):
  b.extend([a[j]])
print(" ".join(b))
# Judge status: Accepted
import math
N=int(input())
#print(N*100/108)
if N * 100 % 108 == 0:
    print(N*100//108)
else:
    kouho=N * 100 // 108
    for i in range(-1,2):
        #print(math.floor((kouho + i) * 1.08))
        if N == math.floor((kouho + i) * 1.08):
            print(kouho + i)
            exit()
    print(":(")
# Judge status: Accepted
import math
N = int(input())
X = list(map(int,input().split()))
med = int(sum(X)/N + 0.5)
c = 0
for i in range(N):
  c += (X[i] - med)**2
print(c)
# Judge status: Accepted
n = int(input())
a = [int(e) for e in input().split()]
b = [int(e) for e in input().split()]
result = 0
for i in range(n):
  if a[i] > b[i]:
    result += b[i]
    a[i] -= b[i]
    b[i] = 0
  else:
    result += a[i]
    b[i] -= a[i]
    a[i] = 0
    if a[i + 1] > b[i]:
      result += b[i]
      a[i + 1] -= b[i]
      b[i] = 0
    else:
      result += a[i + 1]
      b[i] -= a[i + 1]
      a[i + 1] = 0
print(result)
# Judge status: Accepted
a, b = map(int, input().split())

count = 0
for i in range(a, b+1):
  s = str(i)
  if s[:2] == s[3:][::-1]:
    count += 1

print(count)
# Judge status: Wrong Answer
a,b=map(int,input().split())
ct=0
for i in range(1,a+1):
    for j in range(1,32):
        if(a!=b):
            if(i==a):
                break
        elif(i==j):
            ct=ct+1
               
print(ct)
# Judge status: Accepted
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
e = [(pi + 1) / 2 for pi in p]

tmp = 0
for i in range(n):
    tmp += e[i]
    if i >= k:
        tmp -= e[i - k]
    ans = max(ans, tmp)

print(ans)
# Judge status: Accepted
N = int(input())
pre_t = 0
pre_x = 0
pre_y = 0
for i in range(N):
    t,x,y = map(int, input().split())
    if (t%2)+(x+y)%2 == 1 or x+y > t or abs(pre_x-x)+abs(pre_y-y) > (t-pre_t):
        print("No")
        exit()
    pre_t = t
    pre_x = x
    pre_y = y
print("Yes")
# Judge status: Wrong Answer
X=int(input())
sum=0
A=100
while sum<X:
  A=(A*101)//100
  sum+=1
print(sum)
# Judge status: Accepted
import numpy as np

N = int(input())
XY_set = np.array(list(set(tuple(map(int, input().split())) for _ in range(N))))

XpY = XY_set[:, 0] + XY_set[:, 1]
XmY = XY_set[:, 0] - XY_set[:, 1]

ans = max(XpY.max() - XpY.min(), XmY.max() - XmY.min())
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
S=a*b//2
print(S)
# Judge status: Accepted
a,b=map(int,input().split(' '))
if a<=0<=b:
    print("Zero")
elif a > 0 or (abs(b-a)%2!=0):
    print("Positive")
else:
    print("Negative")
# Judge status: Wrong Answer
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
now = n
for i in range(1,n+1):
  if now == i:
    print(i);break
  elif now - i <= i:continue
  else:
    now -= i
    print(i)
# Judge status: Accepted
n = int(input())
ans = ''
while n!=0:
    bit = '0'
    if n%2 != 0:
        n -= 1
        bit = '1'
    ans = bit + ans
    n//=-2
if ans == '': ans = '0'
print(ans)
# Judge status: Accepted
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i*j == n:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
num_input = [input() for i in range(3)]
a = int(num_input[0].split()[0])
v = int(num_input[0].split()[1])
b = int(num_input[1].split()[0])
w = int(num_input[1].split()[1])
t = int(num_input[2].split()[0])

hoge=b-a
if hoge<0:
    hoge=hoge*-1

if v-w<=0:
    ans="NO"
elif t*(v-w)>=hoge:
    ans="YES"
else:
    ans="NO"
    
print(ans)
# Judge status: Accepted

def solve():

    S = input()
    print('Heisei' if S <= '2019/04/30' else 'TBD')


if __name__ == "__main__":
    solve()
# Judge status: Accepted
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

d = []
for x, l in XL:
    d.append([x + l, l])

d.sort()

inf = float('inf')

pre = - inf
ans = N
for dd in d:
    if dd[0] - 2 * dd[1] < pre:
        ans -= 1
    else:
        pre = dd[0]

print(ans)
# Judge status: Wrong Answer
import re
s = input()
t = input()
result=0
if(re.fullmatch(r'[a-z]{1-20000}', s) and re.fullmatch(r'[a-z]{1-20000}', t)):
    for i, j in s, t:
        if i==j:
            result+=1
    print(result)