Harryxun/stf_run huggingface dataset:
n=int(input())
a=list(map(int,input()))
odd=0
even=0
for i in range(n):
  if a[i]%2 == 0:
    even += 1
  else:
    odd += 1
if odd % 2 == 0:
  if (even + odd//2) % 2 == 0:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))
tmp = 0
for i in range(n):
  if arr[i] % 2 == 1:
    tmp += 1
if tmp % 2 == 0:
  print('YES')
else:
  print('NO')
n,d=map(int, input().split())
x=[list(map(int, input().split())) for i in range(n)]

ans=0

for i in range(n):
    for j in range(i+1, n):
        xi,xj = x[i],x[j]
        tmp = 0
        for k in range(d):
            tmp += (xi[d]-xj[d]) ** 2
        if (tmp ** 0.5)%1==0:
            ans += 1

print(ans)



### FIXED CODE ###

from math import sqrt
n,d=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

ans=0
tmp=0

for i in range(n):
  for j in range(i+1, n):
    xi,xj = x[i],x[j]
    for k in range(d):
      tmp += (xi[k]-xj[k]) ** 2  
    if sqrt(tmp)%1==0:
      tmp=0
      ans += 1
    else:
      tmp=0

print(ans)
n,k=map(int,input().split())
l=list(map(int,input().split()))
ans=[]
for i in range(n-k+1):
  ans.append(min(abs(l[i])+abs([l[i]-l[i+k-1]),abs(l[i+k-1])+abs(l[i+k-1]-l[i])))
print(min(ans))

### FIXED CODE ###

n,k=map(int,input().split())
l=list(map(int,input().split()))
ans=[]
for i in range(n-k+1):
  ans.append(min(abs(l[i])+abs(l[i]-l[i+k-1]),abs(l[i+k-1])+abs(l[i+k-1]-l[i])))
print(min(ans))
n, m = map(int, input().split())
s = [0]*m
c = [0]*m

for i in range(m):
  s[i], c[i] = map(int, input().split())

z = [0]*m
r = [0]*m
for i in range(m):
  r[s[i] - 1] = c[i]
  if s.count(s[i]) > 1:
    z[i] = i
if m > 1:
  if c[z[0]] != c[z[1]]:
    print(-1)
    exit()
if r[0] == 0 and n != 1:
  print(-1)
  exit()

if m >= 3:
  ans = r[0]*100 + r[1]*10 + r[2]*1
elif m == 2:
  ans = r[0]*10 + r[1]*1
else:
  ans = r[0]
print(ans)


### FIXED CODE ###

N, M = map(int,input().split())
sc = []
for _ in range(M):
    s, c = input().split()
    s = int(s)
    if s > N:
        print('-1')
        exit()
    sc.append([s, c])
 
ans = -1
if N == 1:
    start = 0
else:
    start = 10 ** (N - 1)
for i in range(start, 10 ** N):
    str_num = str(i)
    for s, c in sc:
        if str_num[s - 1] != c:
            break
    else:
        ans = i
        break
print(ans)
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            a=n//i 
            if (a+1)*i<=n:
              a+=1
            n=a
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors
N=int(input())
a=prime_factors(N)
current=0
index=0
anslist=[]
for i in a:
  if i!=current:
    current=i
    anslist.append(1)
  else:
    anslist[-1]+=1
ans=0
for i in anslist:
  k=1
  while (k*(k+1))<=2*i:
    k+=1
  k-=1
  ans+=k
print(ans)


### FIXED CODE ###

a,b=map(int,input().split())
print(a*b)
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''


def caluculate_score():
	return num_kind * num_kind + taste
	
	
N, K = map(int, input().split())
t, d = [0] * N, [0] * N
table = [[] for _ in range(N)]
eat_kind = [0] * N
num_kind = 0

for i in range(N):
	t[i], d[i] = map(int, input().split())
	table[i] = (d[i], t[i] - 1)
	
table.sort()

eat = []
taste = 0

for _ in range(K):
	tmp = table.pop()
	taste += tmp[0]
	eat_kind[tmp[1]] += 1
	if eat_kind[tmp[1]] == 1:
		num_kind += 1
	eat.append(tmp)
	
ans = caluculate_score()
ind_eat = K - 1
ind_table = N - K - 1

while ind_eat >= 0 and ind_table >= 0:
	while eat_kind[eat[ind_eat][1]] <= 1:
		ind_eat -= 1
		
	while eat_kind[table[ind_table][1]] >= 1:
		ind_table -= 1
		
	if not(ind_eat >= 0 and ind_table >= 0):
		break
		
	eat_kind[eat[ind_eat][1]] -= 1
	eat_kind[table[ind_table][1]] += 1
	num_kind += 1
	taste += table[ind_table][0] - eat[ind_eat][0]
	eat[ind_eat], table[ind_table] = table[ind_table], eat[ind_eat]
	score = caluculate_score()
	if score > ans:
		ans = score
		
	ind_eat -= 1
	ind_table -= 1
	
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''


def caluculate_score():
	return num_kind * num_kind + taste
	
	
N, K = map(int, input().split())
t, d = [0] * N, [0] * N
table = [[] for _ in range(N)]
eat_kind = [0] * N
num_kind = 0

for i in range(N):
	t[i], d[i] = map(int, input().split())
	table[i] = (d[i], t[i] - 1)
	
table.sort()

eat = []
taste = 0

for _ in range(K):
	tmp = table.pop()
	taste += tmp[0]
	eat_kind[tmp[1]] += 1
	if eat_kind[tmp[1]] == 1:
		num_kind += 1
	eat.append(tmp)
	
ans = caluculate_score()
ind_eat = K - 1
ind_table = N - K - 1

while ind_eat >= 0 and ind_table >= 0:
	while ind_eat >= 0 and eat_kind[eat[ind_eat][1]] <= 1:
		ind_eat -= 1
		
	while ind_table >= 0 and eat_kind[table[ind_table][1]] >= 1:
		ind_table -= 1
		
	if not(ind_eat >= 0 and ind_table >= 0):
		break

	eat_kind[eat[ind_eat][1]] -= 1
	eat_kind[table[ind_table][1]] += 1
	num_kind += 1
	taste += table[ind_table][0] - eat[ind_eat][0]
	eat[ind_eat], table[ind_table] = table[ind_table], eat[ind_eat]
	score = caluculate_score()
	if score > ans:
		ans = score
		
	ind_eat -= 1
	ind_table -= 1

print(ans)
h,w = map(int, input().split())
al = []
bl = []

for _ in range(h):
    row = list(map(int, input().split()))
    al.append(row)

for _ in range(h):
    row = list(map(int, input().split()))
    bl.append(row)


cl = [ [0]*w for _ in range(h) ]
for i in range(h):
    for j in range(w):
        cl[i][j] = abs(al[i][j] - bl[i][j]) 

INF = 10**9
lim = (h+w)*80//2+1
# dp = [ [INF]*6400 for _ in range(h) ]
dp = [ [ [False]*(lim+1)  for _ in range(w) ] for _ in range(h) ]

dp[0][0][cl[0][0]] = True

for i in range(h):
    for j in range(w):
        for k in range(0,lim+1):
            if dp[i][j][k] == True:
                if i+1 < h:
                    v = cl[i+1][j]
                    dp[i+1][j][k+v] = True
                    dp[i+1][j][abs(k-v)] = True
                if j+1 < w:
                    v = cl[i][j+1]
                    dp[i][j+1][k+v] = True
                    dp[i][j+1][abs(k-v)] = True


for i,v in enumerate(dp[-1][-1]):
    if v == True:
        print(i)
        break

### FIXED CODE ###

h,w = map(int, input().split())
al = []
bl = []

for _ in range(h):
    row = list(map(int, input().split()))
    al.append(row)

for _ in range(h):
    row = list(map(int, input().split()))
    bl.append(row)


cl = [ [0]*w for _ in range(h) ]
for i in range(h):
    for j in range(w):
        cl[i][j] = abs(al[i][j] - bl[i][j]) 

INF = 10**9
lim = (h+w)*80//2+1
# dp = [ [INF]*6400 for _ in range(h) ]
dp = [ [ [False]*(lim+1)  for _ in range(w) ] for _ in range(h) ]

dp[0][0][cl[0][0]] = True

for i in range(h):
    for j in range(w):
        for k in range(0,lim+1):
            if dp[i][j][k] == True:
                if i+1 < h:
                    v = cl[i+1][j]
                    if k+v <= lim: dp[i+1][j][k+v] = True
                    dp[i+1][j][abs(k-v)] = True
                if j+1 < w:
                    v = cl[i][j+1]
                    if k+v <= lim: dp[i][j+1][k+v] = True
                    dp[i][j+1][abs(k-v)] = True


for i,v in enumerate(dp[-1][-1]):
    if v == True:
        print(i)
        break
X,t = map(int,input.split())
snd = X - t
if X > t:
  print(snd)
else:
  print(0)

### FIXED CODE ###

X,t = map(int,input().split())
snd = X - t
if X > t:
  print(snd)
else:
  print(0)
N, M = map(int, input().split())
A = list(map(int, input().split()))

costs = [2,5,5,4,5,6,3,7,6,1000]

def main():
    min_a = 10-1
    for a in A:
        if costs[a-1] < costs[min_a-1]:
            min_a = a
    rep = N//costs[min_a-1]
    res = N%costs[min_a-1]
    if res==0:
        print(str(min_a)*rep)
        return

    cands = []
    i = 1
    while costs[min_a-1]*i+res <= 7:
        for a in A:
            if (costs[min_a-1]*i+res) % costs[a-1] == 0:
                cands.append(a)
        if len(cands)>0:
            break
        i += 1
    if len(cands)>0:
        a = max(cands)
        rep = (N-costs[a-1]) // costs[min_a-1]
        if a>min_a:
            print(str(a) + str(min_a)*rep)
            return
        else:
            print(str(min_a)*rep + str(a))
            return
    
    cands = []
    i = 1
    while costs[min_a-1]*i+res <= 14:
        for a0 in A:
            for a1 in A:
                if (costs[min_a-1]*i+res) % (costs[a0-1]+costs[a1-1]) == 0:
                    cands.append(a0*10+a1)
        if len(cands)>0:
            break
        i += 1
    if len(cands)>0:
        a = max(cands)
        a0 = a//10
        a1 = a%10
        rep = (N-costs[a0-1]-costs[a1-1]) // costs[min_a-1]
        if min_a < a1:
            print(str(a0) + str(a1) + str(min_a)*rep)
        elif mina < a0:
            print(str(a0) + str(min_a)*rep + str(a1))
        else:
            print(str(min_a)*rep + str(a0) + str(a1))
        return


main()

### FIXED CODE ###

costs = [2,5,5,4,5,6,3,7,6]

N, M = map(int, input().split())
A = list(map(int, input().split()))
neginf = -1 * 1e20
D = [neginf]*(N+1)

def dp(n_match):
    D[0] = 0
    for n in range(1,n_match+1):
        arr = [D[n-costs[a-1]] if n-costs[a-1]>=0 else neginf for a in A]
        D[n] = max(arr)+1

def main():
    dp(N)
    n = N
    ans = ''
    while n>1:
        arr = [ a for a in A if  n-costs[a-1]>=0 and D[n-costs[a-1]]==D[n]-1 ]
        if len(arr)>0:
            a = max(arr)
            ans += str(a)
            n -= costs[a-1]
        else:
            break
    print(ans)

main()
n,m,x=map(int,input().split())
c=list(map(int,input().split()) for _ in range(n))
l=[]*n
for i in range(n):
    b=[0,0]
    b[0]+=i+1
    b[1]+=a[i]
    l.append(b)
c=0
ne=0
l1=[0]*n
while True:
    if c==k:
        print(l[ne][1])
        exit()
    ne+=-ne+l[ne][1]-1
    c+=1
    if l1[ne]==0:l1[ne]+=1
    else:break

roop_c=0
while True:
    if c+roop_c==k:
        print(l[ne][1])
        exit()
    if l1[ne]==1:l1[ne]+=1
    else:break
    ne+=-ne+l[ne][1]-1
    roop_c+=1

re=(k-c)%roop_c
if re==0:print(l[ne][0])
else:
    for i in range(re):
        if i==re-1:print(l[ne][1])
        ne+=-ne+l[ne][1]-1

### FIXED CODE ###

n,m,x=map(int,input().split())
c=[list(map(int,input().split())) for _ in range(n)]
l=[]
for i in range(2**n):
    l.append(format(i,'b').zfill(n))
l1=[]
for i in range(len(l)):
    s=[0]*(m+1)
    for j in range(n):
        if l[i][j]=='1':
            for k in range(m+1):
                s[k]+=c[j][k]

    for o in range(1,m+1):
        if s[o]<x:break
        if o==m:l1.append(s[0])
if len(l1)==0:print(-1) 
else:print(min(l1))
import numpy as np
import sys
L,R = map(int,input().split())
a = np.zeros(R-L+1,dtype="int64")
b = 2019
if R - L >= 2018:
  print("0")
  sys.exit()
else:
  for i in range (0,R-L+1):
    d = (L + i) % 2019
    a[i] = d
for i in range (0,R-L+1):
  for j in range (i+1,R-L+1):
    x = (a[i] * a[j]) % 2019
    b = min(b,x)
print(b)

### FIXED CODE ###

L, R = map(int,input().split())
b = 2018
if R - L >= 2019:
  print(0)
else:
  L = L % 2019
  R = R % 2019
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      if b > (i * j) % 2019:
        b = (i * j) % 2019
  print(b)
from collections import deque
S = list(input())
S = deque(S)
Q = int(input())
c = 0
for _ in range(Q):
    q = list(input().split())
    if int(q[0]) == 1:
        if c == 0:
            c = 1
        else:
            c = 0
    else:
        if c == 0:
            if int(q[1]) == 1:
                S.appendleft(q[2])
            else:
                S.append[q[2]]
        else:
            if int(q[1]) == 2:
                S.appendleft(q[2])
            else:
                S.append(q[2])
S = list(S)
if c == 0:
    print("".join(S))
else:
    S = S[::-1]
    print("".join(S))


### FIXED CODE ###

from collections import deque
S = list(input())
S = deque(S)
Q = int(input())
c = 0
for _ in range(Q):
    q = list(input().split())
    if int(q[0]) == 1:
        if c == 0:
            c = 1
        else:
            c = 0
    else:
        if c == 0:
            if int(q[1]) == 1:
                S.appendleft(q[2])
            else:
                S.append(q[2])
        else:
            if int(q[1]) == 2:
                S.appendleft(q[2])
            else:
                S.append(q[2])
S = list(S)
if c == 0:
    print("".join(S))
else:
    S = S[::-1]
    print("".join(S))
N=int(input())
a=list(map(int,input().split()))
arr=[]
for A in a:
    if A%2==0:
        arr.append(A)
    else:
        pass

for n in arr:
    if n%3==0 or n%%==0:
        pass
    else:
        print('DENIED')
        exit()
print('APPROVED')

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
arr=[]
for A in a:
    if A%2==0:
        arr.append(A)
    else:
        pass

for n in arr:
    if n%3==0 or n%5==0:
        pass
    else:
        print('DENIED')
        exit()
print('APPROVED')
import numpy as np
W,H,x,y = map(float, input().split())
print("{0} {1}".format(W*H/2, 1 (x+x=W)and(y+y=H) else 0) )

### FIXED CODE ###

import numpy as np
W,H,x,y = map(float, input().split())
print("{0} {1}".format(W*H/2, 1 if (x+x==W)and(y+y==H) else 0) )
N, M = map(int,input().split(' '))
a = [int(input()) for i in range(M)]
for i in range(M-1):
  if a[i]+1 == a[i+1]:
    print(0)
    exit()
def step(n):
  if n == 0:
    return 1
  tmp = [0]*n
  tmp[0] = 1
  tmp[1] = 2
  if n == 1:
    return 2
  for i in range(2,n):
    tmp[i] = tmp[i-2] + tmp[i-1]
  return tmp[n-1]
ans = step(a[0]-1)
for i in range(1,M):
  n = a[i] - a[i-1] - 2
  ans = ans*step(n)
n = N - a[M-1] -1
ans = ans*step(n)

print(ans%(10**9+7))

### FIXED CODE ###

N, M = map(int,input().split(' '))
a = set([int(input()) for i in range(M)])
ans = [0]*(N+1)
ans[0] = 1
for i in range(1,N+1):
  if i in a:
    ans[i] = 0
  else:
    ans[i] = (ans[i-1]+ans[i-2])%(10**9+7)
print(ans[N])
n = int(input())
ans = ''

for i in range(100):
    if n <= 26**i:
        n -= 1
        for j in range(i)
            ans += chr(ord('a')+N%26)
            n //= 26
        break
    else:
        n -= 26**i

print(ans[::-1])

### FIXED CODE ###

n = int(input())
ans = ''

for i in range(1,99):
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a')+n%26)
            n //= 26
        break
    else:
        n -= 26**i

print(ans[::-1])
N,Q = map(int, input.split())
S = input()
t = [0] * (N+1)

for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l,r = map(int, input.split())
    print(t[r-1] - t[l-1])


### FIXED CODE ###

N,Q = map(int, input().split())
S = input()
t = [0] * (N+1)

for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l,r = map(int, input().split())
    print(t[r-1] - t[l-1])
A,B,K = map(int,input().split())

if A>K:
    i =A-K 
elif (A+B) > K:
    i =0
    j =(A+B)-K 
else:
    i =0
    j =0
print(i,j)

### FIXED CODE ###

A,B,K = map(int,input().split())

if A>=K:
    i =A-K 
    j =B
elif (A+B) >= K:
    i =0
    j =(A+B)-K 
else:
    i =0
    j =0
print('{} {}'.format(i,j))
N = input()
vals = input().split()
count = 0
while True:
    for val in vals:
        if val % 2 == 1:
            break
    else:
        vals = map(lambda x: x/2, vals)
        continue
    break
print (count)

### FIXED CODE ###

N = int(input())
vals = list(map(int, input().split()))
count = 0
is_odd = False
while True:
    for i in range(0, N):
        if vals[i] % 2 == 1:
            is_odd = True
        vals[i] /= 2
    if is_odd:
        break
    count += 1
print (count)
import sys
from collections import namedtuple

import numpy as np

length = int(sys.stdin.readline())

values = np.array([int(i) for i in sys.stdin.readline().split()], dtype=np.int32)
values = np.sort(values)[::-1]

next_ptr = np.zeros(shape=values.shape, dtype=np.int32)-1
next_ptr[0] = 0

total_score = 0
for index in range(1, len(values)):
  best_index = 0
  best_score = 0
  i = np.where(next_ptr>=0)[0]
  next_i = next_ptr[i]
  values_i = values[i]
  next_values_i = values[next_i]
  scores = np.min([values_i, next_values_i], axis=0)
  best_index = np.argmax(scores)
  
  total_score += scores[best_index]
  
  next_ptr[index] = next_ptr[best_index]
  next_ptr[best_index] = index
  
print(total_score)

### FIXED CODE ###

import sys
import math

price = int(sys.stdin.readline().strip())

if price % 1000 == 0:
  print(0)
else:
	print(1000 * (price // 1000 + 1) - price)
n=int(input())
a=sorted(list(map(int,input().split())))
i=0
ans=0
while i<n:
    h=a.count(a[i])
    i+=h
    ans+=abs(h-a[i])
print(ans)

### FIXED CODE ###

import collections
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
c=collections.Counter(a)
i=0
ans=0
while i<n:
    h=c[a[i]]
    if h>=a[i]:
        ans+=h-a[i]
    else:
        ans+=h
    i+=h
print(ans)
x=int(input())
def beki(n):
    for i in range(2,10000):
        if n%i==0:
            t=
            while n>=1:
                n/=i
                if n==1 and t>=1:
                    return True
                if n<1:
                    return False
                t+=1
y=1
for i in range (1,x+1):
    if beki(i)==True:
        y=i
print(y)

### FIXED CODE ###

x=int(input())
def beki(n):
    for i in range(2,32):
        k=n
        if k%i==0:
            t=0
            while k>=1:
                k/=i
                if k==1 and t>=1:
                    return True
                t+=1
y=1
for i in range (1,x+1):
    if beki(i)==True:
        y=i
print(y)
from math import ceil

def attack(AB,H,N):
    AB.sort(key = lambda x:x[1])
    count = 0
    while H > 0:
        if AB[N-1][1] >= H:
            count += 1
            H = 0
            N -= 1
        elif len(AB) >= 2:
            if AB[N-1][0] >= AB[N-2][1]:
                num = ceil((H-AB[N-1][1])/AB[N-1][0])
                H -= num*AB[N-1][0]
                count += num
            else:
                count += 1
                H -= AB[N-1][1]
                N -= 1
        else:
            num = ceil((H-AB[N-1][1])/AB[N-1][0])
            H -= num*AB[N-1][0]
            count += num

    return count

def main():
    N,H = map(int,input().split())
    AB = [list(map(int,input().split())) for _ in range(N)]

    print(attack(AB,H,N))

if __name__ == "__main__":
    main()


### FIXED CODE ###

from math import ceil

def attack(ab,N,H):
    cut_max = 0
    for i in range(N):
        cut_max = max(cut_max,ab[i][0])

    throw = [ab[i][1] for i in range(N)]
    throw.sort(reverse = True)
    throw.append(0)

    cnt,pt = 0,0
    while H > 0:
        if throw[pt] > cut_max:
            H -= throw[pt]
            cnt += 1
            pt += 1
        else:
            cnt += (ceil(H/cut_max))
            H = 0

    return cnt

def main():
    N,H = map(int,input().split())
    ab = [list(map(int,input().split())) for _ in range(N)]

    print(attack(ab,N,H))

if __name__ == "__main__":
    main()
max_v = 1000000000
min_v = -1000000000

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

for r in data:
    max_v = max(max_v, r - min_v)                                               
    min_v = min(min_v, r)
    
print(3)

### FIXED CODE ###

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

min_value = data.pop(0)
earn_value = -1000000000000
for d in data:
    earn_value = max(d - min_value, earn_value)
    min_value = min(d, min_value) 
print(earn_value)
a,b,c,d=map(int,input(),split())
print("Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced")

### FIXED CODE ###

a,b,c,d=map(int,input().split())
print("Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced")
import math

INT_MAX = 2147483647
MAX = 100003
n,q=(int(x) for x in input().split())
b= math.sqrt(n)


def judge_max(x,y):
    
    if x > y :return x
    else:return y 

def judge_min(x,y):
    if x > y :return y
    else :return x



def update(x):
 
    for i in range(int(x*b),int(judge_min(n-1,(x+1)*b))):a[i]=l[int(x)]
    l[int(x)]=-1;
    return;
 

if __name__=='__main__':
    a = [INT_MAX for i in range(n)]
    l = [-1 for i in range(n)]
    
   
    for i in range(q):
        t, *com = (int(x) for x in input().split())
        if t : 
            x = com[0]
            if l[int(x/b)] != -1:update(x/b)
            print(a[x])
        else:
            x,y,z = com
            if l[int(x/b)] != -1:update(x/b)
            for i in range(x,int(judge_min(y,(x/b+1)*b))):a[i]=z
            for i in range(int(x/b)+1,int(y/b)):l[i]=z
            if l[int(y/b)] != -1:update(y/b)
            for i in range(int(judge_max(x,y/b**2)),y+1):a[i]=z

            




### FIXED CODE ###

M = 2147483647
a = [M for i in range(500000)]

def j_min(x,y):
    if x < y:return x
    else: return y

def find(x,y,i,l,r):
    if r<=x or y<=l:return M
    if x<=l and r<=y: return a[i]
    return j_min(find(x,y,i*2,l,(l+r)/2),find(x,y,i*2+1,(l+r)/2,r))

if __name__=='__main__':
    n, m = (int(x) for x in input().split())
    t=1
    while t<n :t *= 2

    for i in range(m-1,-1,-1):
        com,x,y = (int(x) for x in input().split())
        if com :
            #continue
            print(find(x,y+1,1,0,t))
        else:
            x+=t
            a[x]=y
            while isinstance(x, int) or x >= 2:
               a[int(x/2)]=j_min(a[int(x)],a[int(x)^1])
               x/=2
n = int(input())
if n % 2 == 1:
    print(0)
elif n % 2 == 0:
    ans = n//10
    kar = n//10
    while True:
        if kar // 5 >= 1:
            ans += kar // 5
            kar = kar// 5
        elif kar // 5 < 1:
            break
print(ans)

### FIXED CODE ###

n = int(input())
if n % 2 == 1:
    print(0)
    exit()
elif n % 2 == 0:
    ans = n//10
    kar = n//10
    while True:
        if kar // 5 >= 1:
            ans += kar // 5
            kar = kar// 5
        elif kar // 5 < 1:
            break
print(ans)
N = int(input())

total = sum([i for i in range(1,N+1) if i%3!=0 and i%5!=0]
print(total)

### FIXED CODE ###

N = int(input())
 
total = sum([i for i in range(1,N+1) if i%3!=0 and i%5!=0])
print(total)
from statistics import median

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

b = int(median([v-i for i, v in enumerate(a, 1)]))
res = 0
print(b)
for i, v in enumerate(a, 1):
    res += abs(v-(b+i))

print(res)

### FIXED CODE ###

import statistics  
N = int(input())
A=list(map(int, input().split()))
B=[]
for number, i in enumerate(A, 1):
    B.append(i-number)
median = int(statistics.median(B))
ans2 = 0
for i in B:
    ans2 += abs(i-median)
print(ans2)