Harryxun/stf_run huggingface dataset:
H,N=map(int,input().split())
AB=[]
for i in range(N):
  AB.append(list(map(int,input().split())))
INF=10**8
dp=[0]*(10**7)
dp[0]=0
i=0

while True:
  i+=1
  for A,B in AB:
    if i-B>=0:
      dp[i]=max(dp[i-B]+A,dp[i])
  if dp[i]>=H:
    break
print(i)

### FIXED CODE ###

H,N=map(int,input().split())
AB=[]
for i in range(N):
  AB.append(list(map(int,input().split())))
dp=[10**8]*(H+1)
dp[0]=0
i=0

for i in range(H+1):
  for A,B in AB:
    if i-A>=0:
      dp[i]=min(dp[i-A]+B,dp[i])
  for A,B in AB:
    if i+A>H:
      dp[-1]=min(dp[-1],dp[i]+B)
print(dp[-1])
def resolve():
    s = input()
    n = len(s)
    counter = [0] * 2019
    counter[0] += 1
    temp = ""
    for i, c in enumeate(s[::-1], 1):
        temp = c + temp
        counter[int(temp) % 2019] += 1

    ans = 0
    for i in counter:
        ans += (i * (i - 1)) // 2

    print(ans)
resolve()

### FIXED CODE ###

a,*d=[0]*2020
for i in map(int,input()):
  p=[0]*2019
  for j in range(2019):p[(j*10+i)%2019]+=d[j]
  d=p
  d[i]+=1
  a+=d[0]
print(a)
import sys
#input = sys.stdin.buffer.readline
import bisect

def main():
    N = int(input())
    S = list(str(input()))
    
    pos = [[] for _ in range(26)]
    for x,s in enumerate(S):
        num = ord(s)-ord("a")
        pos[num].append(x)
    
    q = int(input())
    for _ in range(q):
        m,a,b = map(str,input().split())
        if m == "1":
            a = int(a)-1
            if S[a] == b:
                continue
            else:
                popind = bisect.bisect_left(pos[ord(S[a])-ord("a")],a)
                pos[ord(S[a])-ord("a")].pop(popind)
                bisect.insort(pos[ord(b)-ord("a")],a)
        else:
            a,b = int(a)-1,int(b)
            count = 0
            for i in range(26):
                aind = bisect.bisect_left(pos[i],a)
                bind = bisect.bisect_left(pos[i],b)
                if bind-aind > 0:
                    count += 1
            print(count)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
#input = sys.stdin.buffer.readline
import bisect

def main():
    N = int(input())
    S = list(str(input()))
    
    pos = [[] for _ in range(26)]
    for x,s in enumerate(S):
        num = ord(s)-ord("a")
        pos[num].append(x)
    
    q = int(input())
    for _ in range(q):
        m,a,b = map(str,input().split())
        if m == "1":
            a = int(a)-1
            if S[a] == b:
                continue
            else:
                popind = bisect.bisect_left(pos[ord(S[a])-ord("a")],a)
                pos[ord(S[a])-ord("a")].pop(popind)
                bisect.insort(pos[ord(b)-ord("a")],a)
                S[a] = b
        else:
            a,b = int(a)-1,int(b)-1
            count = 0
            for i in range(26):
                l = bisect.bisect_left(pos[i],a)
                if l >= len(pos[i]):
                    continue
                if pos[i][l] <= b:
                    count += 1
            print(count)

if __name__ == "__main__":
    main()
N = input()
print((N+1)//2)

### FIXED CODE ###

N = int(input())
print((N+1)//2)
n,m = map(int,input().split())
a = list(map(int,input().split()))
bc = [0]*m
for i in range(m):
    bc[i] = list(map(int,input().split()))
sortsecond = lambda val : val[1]
bc.sort(key=sortsecond,reverse = True)
a = sorted(a)
i = 0
j = 0
count = 0
while a[i] < bc[j][1]:
    a[i] = bc[j][1]
    i += 1
    count += 1
    if count == bc[j][0]:
        j += 1
        count = 0
        if j>=m:
            break
print(sum(a))

### FIXED CODE ###

n,m = map(int,input().split())
a = list(map(int,input().split()))
bc = [0]*m
for i in range(m):
    bc[i] = list(map(int,input().split()))
sortsecond = lambda val : val[1]
bc.sort(key=sortsecond,reverse = True)
a = sorted(a)
i = 0
j = 0
count = 0
while a[i] < bc[j][1]:
    a[i] = bc[j][1]
    i += 1
    if i >= len(a):
        break
    count += 1
    if count == bc[j][0]:
        j += 1
        count = 0
        if j>=m:
            break
print(sum(a))
N,M=map(int,input().split())

from scipy.special import comb
# a = comb(n, r)
a = comb(N+M, 2, exact=True)-N*M
print(a)

### FIXED CODE ###

N,M=map(int,input().split())
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

a = cmb(N+M,2)-N*M
print(a)
r4 = range(4)
r13 = range(13)
cards = [[0 for i in r13] for j in r4]
while True:
    n = input()
    for i in range(n):
        s1, s2 = raw_input().split()
        s1 = 'SHCD'.index(s1)
        s2 = int(s2)-1
        cards[s1][s2] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0: print 'SHCD'[j],i+1

### FIXED CODE ###

r4 = range(4)
r13 = range(13)
cards = [[0 for i in r13] for j in r4]

n = input()
for i in range(n):
    s1, s2 = raw_input().split()
    s1 = 'SHCD'.index(s1)
    s2 = int(s2)-1
    cards[s1][s2] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0:
            print 'SHCD'[j],i+1
s = input()
t = input()
n = len(s)
ans = 0
for i in range(n):
    if s[i] != t[i]:
        s[i] = t[i]
        x += 1
print(ans)

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
K,X = map(int,input())

if K*500>=X:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

K,X = map(int,input().split())

if K*500>=X:
  print("Yes")
else:
  print("No")
def counting_sort(A, B, k):
    C = [0 for _ in xrange(k+1)]
    for a in A:
        C[a] += 1

    for i in xrange(k):
        C[i] = C[i] + C[i-1]

    for i in xrange(n-1, -1, -1):
        B[C[A[i]]-1] = A[i]
        C[A[i]] -= 1


n = int(raw_input())
A = map(int, raw_input().split())
B = [0 for _ in xrange(n)]

counting_sort(A, B, 10000)

print " ".join(map(str, B)

### FIXED CODE ###

def counting_sort(A, B, k):
    C = [0 for _ in xrange(k+1)]
    for a in A:
        C[a] += 1

    for i in xrange(1, k+1):
        C[i] = C[i] + C[i-1]

    for i in xrange(n-1, -1, -1):
        B[C[A[i]]-1] = A[i]
        C[A[i]] -= 1


n = int(raw_input())
A = map(int, raw_input().split())
B = [0 for _ in xrange(n)]

counting_sort(A, B, 10000)

print " ".join(map(str, B))
a = int(input())
b = int(input())
print(a*b)
  

### FIXED CODE ###

a,b =map(int,input().split())
if 1 <= a <=100 and 1 <= b <= 100:
     print(a*b)
L = int(input())/3
print(L**3)

### FIXED CODE ###

s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")
N = int(input())
A = list(map(int,input().split()))

for i in range(N):
  now = 0
  ans = 0
  for j in range(N):
    if i != j:
      next = A[j]
      ans += abs(next - now)
      now = next
  ans += abs(B[-1])
  print(ans)


### FIXED CODE ###

N = int(input())
A = [0]
A = A + list(map(int,input().split()))
A = A + [0]

D = 0

for i in range(N + 1):
  D += abs(A[i + 1] - A[i])
  
for i in range(1,N + 1):
  ans = D + abs(A[i + 1] - A[i - 1]) - (abs(A[i] - A[i - 1]) + abs(A[i + 1] - A[i]))
  print(ans)
a, b, c, d = input().split()
print("No") if (a // d + 1) < (c // b + 1) else print("Yes")

### FIXED CODE ###

import math
a, b, c, d = map(int, input().split())
print("No") if math.ceil(a/d) < math.ceil(c/b) else print("Yes")
a = int(input())
b = int(input())
if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')

### FIXED CODE ###

a, b = map(int, input().split())
if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')
L,R = map(int,input().split())

# L <= i,j <== R の中で、i*j mod 2019の最小値を求めよ

# L,R は 0 ~ 2*10^9

# (i*j) mod 2019 = (i mod 2019) * (j mod 2019)

if(R <= 2019):
    ans = (R%2019)* ((R-1)%2019)

if(L >= 2019):
    if(L % 2019 < R % 2019):
        ans = (L % 2019)* ((L+1)%2019)
    else:
        ans = (R%2019)* ((R-1)%2019)
print(ans)

### FIXED CODE ###

L,R = map(int,input().split())

# L <= i,j <== R の中で、i*j mod 2019の最小値を求めよ

# L,R は 0 ~ 2*10^9

# (i*j) mod 2019 = (i mod 2019) * (j mod 2019) %2019

# =============================================================================
# for i in range(2019):
#     for j in range(i,2019):
#         a = (i*j) % 2019
#         b = (i % 2019)*(j % 2019) % 2019
#         if a != b:
#             print(i,a,b)
# =============================================================================

# 全探索: 2019*2019が最大

dist = (R - L)
if dist >= 2019:
    print("0")
else:
    ans = 999999
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans = min(ans,(i*j) % 2019)
    print(ans)
n = input()
A = list(map(int,input().split()))
ans = 1
 
for i in range(n):
	ans = ans*A[i]
if ans >= 10**18
	ans = -1
print(ans)

### FIXED CODE ###

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

if 0 in A:
  ans = 0
else:
  for i in range(n):
    ans = ans*A[i]
    if ans > 10**18:
        ans = -1
        break
 
print(ans)
N= int(input());E = [input().split()[2:] for _ in range(N)]
frag, T, L,Q = [0]*N, [0]*N, [0]*N, [0]
a,frag[0] = 100, 1
def func(ide):
    for i in E[ide]:
        i = int(i) - 1
        if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i) 
        else:return

while Q:top = Q[0];func(top);del Q[0]
for i in range(n):
    if L[i] == 0:
        L[i] == -1

for i in range(N):print(i + 1 ,int(L[i]))



### FIXED CODE ###

N= int(input())
E = [input().split()[2:] for _ in range(N)]
Q = [0]
L = [0] + [-1]*N
frag = [1] + [0]*N
def func(ide):
    global Q
    for i in E[ide]:
        i = int(i) - 1
        if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i)
        
    

while Q:top = Q[0];func(top);del Q[0]

for i in range(N):print(i + 1 ,int(L[i]))
S = input()
a = len(S)
print(str(S[0]+a+S[-1])

### FIXED CODE ###

S = input()
a = len(S)
print(S[0]+ str(a-2) + S[-1])
N,M=map(int,input().split())
L=[]

ans=0

for i in range(N):
    a,b=map(int,input().split())

    L.append([a,b])

L= sorted(L)



for i in range(N):

    ans = L[i][0]*L[i][1]
    M -= L[i][1]


    if M <= L[i+1][1]:

        ans += M * L[i+1][0]

        print(ans)

        exit()

### FIXED CODE ###

N,M=map(int,input().split())
L=[]
ans=0

for i in range(N):
    a,b=map(int,input().split())

    L.append([a,b])

L= sorted(L)

for i in range(N):

    if M < L[i][1]:
        ans=L[i][0]*M

        print(ans)
        exit()
        
    else:
        ans += L[i][0]*L[i][1]
        M -= L[i][1]

        if M==0:

            print(ans)
            exit()

        elif M <= L[i+1][1]:

            ans += M * L[i+1][0]
            print(ans)
            exit()
import collections
n = int(input())
l = sorted(list(map(int, input().split())) )
c = collections.Counter(l)
L = [0]*10**5
M = [0]*10**5

for x,y in c.items():
    L[x-1] += y

M[0] = L[0]
M[n] = L[n]
for i in range(1,10**5-1):
    M[i] = L[i-1] + L[i] + L[i+1]
print(max(M))

### FIXED CODE ###

import collections
n = int(input())
l = sorted(list(map(int, input().split())) )
c = collections.Counter(l)
L = [0]*(10**5+1)
M = [0]*(10**5+1)
 
for x,y in c.items():
    L[x] += y
 
M[0] = L[0]
M[10**5] = L[10**5]
for i in range(1,10**5):
    M[i] = L[i-1] + L[i] + L[i+1]
print(max(M))
n, L = map(int, input().split())
N = 0
G = 999
for i in range(1, n+1):
    N += (i + L - 1)
NN = N
for i in range(1, n+1):
    DD = NN - (L + i - 1)
    if abs(NN-DD)< G :
        G = abs(NN-DD)
        ZZ = DD
print(ZZ)

### FIXED CODE ###

A=str(input () )
B=0
while B!=3:
    if A[B]==A[B+1]:
        print('Bad')
        break
    else:    
        B=B+1
else:
    print('Good')
nk=input().split()

n=int(nk[0])
k=int(nk[1])

weight=[int(input()) for i in range(n)]

def ok(m):
    load=0
    track=1
    # sum all the weight and count the track number we need
    for i in range(n):
        load+=weight[i]
        if load==m:
            load=0
            if i!=n-1:
                track+=1
        elif load>m:
            if weight[i]>m:
                return False
            else:
                load=weight[i]
                track+=1
        else:
            continue

    if track<=k:
        return True
    else:
        return False

low=0
high=sum(weight)//(k//2)
while low+1<high:
# low<mid<high
#not ok(l) and ok(h)
    mid=(low+high)//2
    if ok(mid):
        high=mid
    else:
        low=mid



print(high)

### FIXED CODE ###




nk=input().split()

n=int(nk[0])
k=int(nk[1])

weight=[int(input()) for i in range(n)]

def ok(m):
    load=0
    track=1
    # sum all the weight and count the track number we need
    for i in range(n):
        load+=weight[i]
        if load==m:
            load=0
            if i!=n-1:
                track+=1
        elif load>m:
            if weight[i]>m:
                return False
            else:
                load=weight[i]
                track+=1
        else:
            continue

    if track<=k:
        return True
    else:
        return False

low=0
high=sum(weight)
while low+1<high:
# low<mid<high
#not ok(l) and ok(h)
    mid=(low+high)//2
    if ok(mid):
        high=mid
    else:
        low=mid



print(high)
a = abs(x//d)
b = x%d

if k <= a:
    print(abs(abs(x)-k*d))

else:
    tmp = k-abs(a)
    if tmp%2 == 0:
        print(abs(x)-a*d)
    else:
        print(abs(abs(x)-(a+1)*d))


### FIXED CODE ###

x,k,d = map(int,input().split())
#print(x,k,d)
x=abs(x)
a = x//d
b = x%d

if k <= a:
    print(abs(x-k*d))

else:
    tmp = k-a
    if tmp%2 == 0:
        print(x-a*d)
    else:
        print(abs(x-(a+1)*d))
a,b,c = [int(i), for i in input()]

print(a+b+c)


### FIXED CODE ###

a,b,c = [int(i) for i in input()]

print(a+b+c)
N,K = list(map(int, input().split()))
A = list(map(int, input().split()))
r = 0
if K <= N:
    current = 0
    for i in K:
        current = A[current-1]
    print(current+1)
else:
    isReturn = [0]*(N+1)
    step = 1
    current = 1
    isReturn[current] = step
    for i in range(K):
        current = A[current-1]
        step += 1
        if isReturn[current] == 0:
            isReturn[current] = step
        else:
            r = step - isReturn[current]
            b = isReturn[current] - 1
            break
    
    t = (K-step) % N
    for i in range(t+1):
        current = A[current-1]
        
    print(current)
    
    
                
            
    
    
                
            


### FIXED CODE ###

N,K = list(map(int, input().split()))
A = list(map(int, input().split()))
r = 0
if K <= N:
    current = 1
    for i in range(K):
        current = A[current-1]
    print(current)
else:
    isReturn = [0 for i in range(N)]
    step = 1
    current = 1
    isReturn[current-1] = step
    for i in range(N):
        current = A[current-1]
        step += 1
        if isReturn[current-1] == 0:
            isReturn[current-1] = step
        else:
            r = step - isReturn[current-1]
            break
    
    t = ((K-step) % r) + 1
    for i in range(t):
        current = A[current-1]
        
    print(current)
N = int(input())
    a = list(map(int, input().split()))
    l = a[0]
    for i in range(1,N):
        l = l * a[i] // fractions.gcd(l, a[i])
    # print(l)

    m = l-1

    # f
    fm = 0
    for i in range(N):
        fm += m % a[i]
    print(fm)

### FIXED CODE ###

import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)
cij =[]
for i in range(3):
    cij.append(list(map(int, input().split(" "))))

bi_list = []
for b1 in range(100):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])
    if b2 < 0 or b3 < 0 or b2 > cij[0][1] or b3 > cij[0][2] :
        continue
    bi_list.append([b1, b2, b3])

for bi in bi_list:
    a1 = cij[0][0]+cij[0][1]+cij[0][2] -bi[0]-bi[1]-bi[2] 
a2 = cij[1][0]+cij[1][1]+cij[1][2] -bi[0]-bi[1]-bi[2] 
a3 = cij[2][0]+cij[2][1]+cij[2][2] -bi[0]-bi[1]-bi[2] 
    if (a1) % 3 == 0 and (a2) % 3 == 0 and (a3) % 3 == 0 and a1 >=0 and a2 >= 0 and a3 >= 0:
        print("Yes")
        exit()

print("No")

### FIXED CODE ###

cij =[]
for i in range(3):
    cij.append(list(map(int, input().split(" "))))

bi_list = []
for b1 in range(-50000, 50000):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])

    a1 = cij[0][0]+cij[0][1]+cij[0][2] -b1-b2-b3
    a2 = cij[1][0]+cij[1][1]+cij[1][2] -b1-b2-b3
    a3 = cij[2][0]+cij[2][1]+cij[2][2] -b1-b2-b3
    if a1/3+b1 ==cij[0][0] and a1/3+b2 ==cij[0][1] and a1/3+b3 ==cij[0][2] and a2/3+b1 ==cij[1][0] and a2/3+b2 ==cij[1][1] and a2/3+b3 ==cij[1][2] and a3/3+b1 ==cij[2][0] and a3/3+b2 ==cij[2][1] and a3/3+b3 ==cij[2][2]:
            print("Yes")
            exit()

print("No")
ai = lambda: list(map(int, input().split()))

n,m = ai()
x = ai()
y = ai()
mod = 10**9+7
ans = 0

sx,ssx,sy,ssy = [x[0]], [x[-1]], [y[0]], [y[-1]]
for i in range(1, n):
    sx.append(sx[-1] + x[i])
    ssx.append(ssx[-1] + x[-i-1])
    sy.append(sy[-1] + y[i])
    ssy.append(ssy[-1] + y[-i-1])

a = sum(ssx[i] - sx[i] for i in range(n)) % mod
b = sum(ssy[i] - sy[i] for i in range(n)) % mod

ans = a*b % mod
print(ans)

### FIXED CODE ###

ai = lambda: list(map(int, input().split()))

n,m = ai()
x = ai()
y = ai()
mod = 10**9+7
ans = 0

sx,ssx,sy,ssy = [x[0]], [x[-1]], [y[0]], [y[-1]]
for i in range(1, n):
    sx.append(sx[-1] + x[i])
    ssx.append(ssx[-1] + x[-i-1])
for i in range(1, m):
    sy.append(sy[-1] + y[i])
    ssy.append(ssy[-1] + y[-i-1])

a = sum(ssx[i] - sx[i] for i in range(n)) % mod
b = sum(ssy[i] - sy[i] for i in range(m)) % mod

ans = a*b % mod
print(ans)
while True:
    table = map(int,input().split())
    a = int(table[0])
    op = table[1]
    b = int(table[2])
    
    if op == "?":
        break
    
    if op == "+":
        print("%d" %(a+b))
    elif op == "-":
        print("%d"%(a-b))
    elif op == "*":
        print("%d"%(a*b))
    else:
        print("%d"%(a%b))


### FIXED CODE ###

while True:
    table = input().split()
    
    a = int(table[0])
    op = table[1]
    b = int(table[2])
    
    if op == "?":
        break
    
    if op == "+":
        print("%d"%(a+b))
    elif op == "-":
        print("%d"%(a-b))
    elif op == "*":
        print("%d"%(a*b))
    else:
        print("%d"%(a/b))
s = input()
pirnt(s[:3]+'7'+s[4:])

### FIXED CODE ###

s = input()
print(s[:3]+'8'+s[4:])
import heapq
N,M = map(int,input().split())
dic = {}
for i in range(N):
  A,B = map(int,input().split())
  if A <= M:
    if dic[A]:
      dic[A].append(B)
    else:
      dic[A] = [B]
      
ans = 0
plan = heapq()
for i in range(1,M+1):
  for w in dic[i]:
    heapq.heappush(plan,-w)
  if len(plan) != 0:
    ans += heappop(plan)

print(-ans)
	

### FIXED CODE ###

import heapq
N,M = map(int,input().split())
dic = {}
for i in range(N):
  A,B = map(int,input().split())
  if A <= M:
    if A in dic.keys():
      dic[A].append(B)
    else:
      dic[A] = [B]
      
ans = 0
plan = []
for i in range(1,M+1):
  if i in dic.keys():
    for w in dic[i]:
        heapq.heappush(plan,-w)
  if len(plan) != 0:
    ans += heapq.heappop(plan)

print(-ans)
S = input()
K = int(input())
a = 10 ** 18
print(a)
counter = 0
for i in S:
    if int(i) != 1:
        log = counter
        num = int(i)
        break
    counter += 1

if K == 1:
    print(S[0])
elif K <= log:
    print(1)
else:
    print(num)


### FIXED CODE ###

S = input()
K = int(input())
counter = 0
num = 1
log = 0
for i in S:
    if int(i) != 1:
        log = counter
        num = int(i)
        break
    counter += 1

if K <= log:
    print(1)
else:
    print(num)
n,W = map(int,input().split())
w,v = [0]*n, [0]*n
for i in range(n):
    w[i], v[i] = map(int,input().split())

dp = [[0]*(W+1) for _ in range(n+1)]
for i in range(n):
    for j in range(W+1):
        if j-w[i]>=0:
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-w[i]]+v[i])
        dp[i+1][j] = max(dp[i+1][j],dp[i][j])
print(dp[n][W])

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))

dp = [float("inf") for _ in range(n)]
dp[0] = 0
for i in range(n-1):
    dp[i+1] = min(dp[i+1], dp[i]+abs(h[i+1]-h[i]))
    if i<n-2:
        dp[i+2] = min(dp[i+2], dp[i]+abs(h[i+2]-h[i]))
print(dp[n-1])
N = int(input())
A = list(map(int, input().split()))
judge = 0
while 0 in A:
    A.remove(0)
for i in range(len(set(A))):
    if set(A)[i+1] - set(A)[i] == 2:
        judge = 1
    else:
        judge = 0
        break
if len(set(A)) == len(A)/2 and judge:
    print(2 ** (len(A) // 2))
else:
    print(0)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
judge = 1
while 0 in A:
    A.remove(0)

A_ = list(set(A))
A_.sort()
for i in range(len(A_) - 1):
    if A_[i+1] == A_[i]+2:
        judge = 1
    else:
        judge = 0

if len(set(A)) == len(A)/2 and judge:
    print((2 ** (len(A) // 2)) % (10**9 +7))
else:
    print(0)
n=[int i for i in input.split()]
print(n[0]+n[1]/2)

### FIXED CODE ###

n=[int(i) for i in input().split()]
print(int(n[0]+n[1]/2))
from heapq import heappush,heappop 
from math import sqrt
inf=float("inf")

xs,ys,xt,yt=map(int,input().split())
n=int(input())

q=[]
l=[(xs,ys,0),(xt,yt,0)]+[tuple(map(int,input().split())) for _ in range(n)]

sizeV=len(l)
rests={*range(sizeV)}
cost=[inf]*sizeV
cost[0]=0
heappush(q,(0,0))

while q:
  c1,i=heappop(q)
  if c1>cost[i]:continue

  rests.remove(i)
  if not rests:break

  costnow=c1
  xi,yi,ri=l[i]
  for j in rests:
    xj,yj,rj=l[j]
    d=max(0.0,sqrt((xj-xi)**2+(yj-yi)**2)-ri-rj)
    c2=costnow+d
    if c2<cost[j]:
      cost[j]=c2
      heappush(q,(c2,j))

print(cost[1])

### FIXED CODE ###

from heapq import heappush,heappop 
from math import sqrt
inf=float("inf")

xs,ys,xt,yt=map(int,input().split())
n=int(input())

q=[]
l=[(xs,ys,0),(xt,yt,0)]+[tuple(map(int,input().split())) for _ in range(n)]

sizeV=len(l)
rests=set(range(sizeV))
cost=[inf]*sizeV
cost[0]=0
heappush(q,(0,0))

while q:
  c1,i=heappop(q)
  if c1>cost[i]:continue

  rests.remove(i)
  if not rests:break

  xi,yi,ri=l[i]
  for j in rests:
    xj,yj,rj=l[j]
    d=max(0.0,sqrt((xj-xi)**2+(yj-yi)**2)-ri-rj)
    c2=c1+d
    if c2<cost[j]:
      cost[j]=c2
      heappush(q,(c2,j))

print(cost[1])
from fractions import gcd

n, m = map(int, input().split())

s = input()
t = input()

# accept
# a c p
# a  e

# 最小公倍数。被ったらNG
l = n * m // gcd(n, m)
x = [None] * (n*m)
for i, c in enumerate(s):
    x[i*l//n] = c

for i, c in enumerate(t):
    a = x[i*l//m]
    if a is None:
        continue
    elif a != c:
        print(-1)
        exit()

print(l)


### FIXED CODE ###

from fractions import gcd

n, m = map(int, input().split())

s = input()
t = input()

# accept
# a c p
# a  e

g = gcd(n, m)
a = n // g
b = m // g
for i in range(g):
    if s[i*a] != t[i*b]:
        print(-1)
        exit()

print(n*m//g)
n,x,t=int(input().split())
print(n*x/t)

### FIXED CODE ###

n,x,t=map(int,input().split())
print(-n//x*-t)
n=int(input())
k=int(input())
xx=list(map(int.input().split()))

diff=0
for x in xx:
  diff+=2*min(abs(x),abs(x-k))
print(diff)
  

### FIXED CODE ###

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

diff=0
for x in xx:
  diff+=2*min(abs(x),abs(x-k))
print(diff)
n = input()
cur = 0
for x in n:
cur += int(x)
if cur % 9 == 0:
print("Yes")
else:
print("No")

### FIXED CODE ###

n = input()
cur = 0

for x in n:
    cur += int(x)

if cur % 9 == 0:
    print("Yes")
else:
    print("No")
alphabet="abcdefghijklmnopqrstuvwxyz"
st=input()
s=""
for i in range(0,len(st)):
    if alphabet.index(st[i]) % 2 == 0:
        s+=str(st[i])
    else:
        pass
print(s)


### FIXED CODE ###

X,t = map(int, input().split())
if X-t<0:
    print(str(0))
else:
    print(str(X-t))