Harryxun/stf_run huggingface dataset:
n,q=map(int,input().split())

# 隣接グラフ
to=[[] for i in range(n)] 
ans=[0 for i in range(n)]

# 深さ優先探索
def dfs(v, p=-1):
    global to,ans
    for u in to[v]:
        if u==p:
            continue
        ans[u]+=ans[v]
        dfs(u,v)

# 隣接グラフ作成
for _ in range(n-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    to[a].append(b)
    to[b].append(a)

for _ in range(q):
    p,x=map(int,input().split())
    p-=1
    ans[p]+=x

dfs(0)

for i in ans:
    print(i)

### FIXED CODE ###

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

# 隣接グラフ
to=[[] for i in range(n)] 
ans=[0 for i in range(n)]


# 深さ優先探索(再帰)
def dfs(v, p=-1):
    global ans
    for u in to[v]:
        if u==p:
            continue
        ans[u]+=ans[v]
        dfs(u,v)

# 深さ優先探索(ループ)
def dfs2():
    global ans
    queue=list()
    visit=dict()

    queue.append(0)
    for v in queue:
        visit.setdefault(v,True)
        for u in to[v]:
            if u in visit:
                continue
            ans[u]+=ans[v]
            queue.append(u)

# 隣接グラフ作成
for _ in range(n-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    to[a].append(b)
    to[b].append(a)

for _ in range(q):
    p,x=map(int,input().split())
    p-=1
    ans[p]+=x

#dfs(0)
dfs2()

for i in ans:
    print(i)
#ABC124-C 別解
S = input()
c = 0
zo = 0
oz = 0
for i in range(0, len(S), 2):
    if S[i] == '0':
        oz += 1
    else:
        zo += 1
    if S[i+1] == '0':
        zo += 1
    else:
        oz += 1
if len(S) & 1:
    if S[-1] == '0':
        oz += 1
print(min(oz, zo))

### FIXED CODE ###

S = input()
p01 = 0
p10 = 0
p00 = 0
p11 = 0
for i in range(0, (len(S)//2 * 2), 2):
    if S[i:i+2] == '01':
        p01 += 1
    elif S[i:i+2] == '10':
        p10 += 1
    elif S[i:i+2] == '00':
        p00 += 1
    else:
        p11 += 1
#print(p01,p10,p00,p11)
c = 0
if (p01 == 0) and (p10 == 0):
    c = len(S) // 2
elif p01 >= p10:
    c = p10 * 2 + p00 + p11
    if len(S) & 1:
        if S[-1] == S[-2]:
            c += 1
else:
    c = p01 * 2 + p00 + p11
    if len(S) & 1:
        if S[-1] == S[-2]:
            c += 1
print(c)
s = input()
K = int(input())
l = []
if len(s) == 1:
    print(s)
    exit()
for i in range(len(s) - 1):
    for j in range(i, len(s)):
        d = s[i:j+1]
        l.append(d)
l = list(set(l))
l.sort()
print(l[K-1])

### FIXED CODE ###

s = input()
K = int(input())
l = []
if len(s) == 1:
    print(s)
    exit()
for i in range(len(s)):
    for j in range(i, len(s)):
        d = s[i:j+1]
        l.append(d)
        if len(d) >= K:
            break
l = list(set(l))
l.sort()
print(l[K-1])
while True:
    h,w=map(int,input().split())
    if h+w==0:break
    for x in range(1,h+1):
    print("#"*w)
    print( )

### FIXED CODE ###

while True:
    h,w=map(int, input().split())
    if h==w== 0:break
    print(('#' * w + '\n') * h)
# encoding:utf-8
import copy
import numpy as np
import random

n = int(input())
X = []
Y = []
H = []
for i in range(n):
    x,y,h = map(int,input().split())
    X.append(x)
    Y.append(y)
    H.append(h)

for x in range(101):
    for y in range(101):
        ans_h = None
        done = False
        for i in range(n):
            if done == False:
                if ans_h is None:
                    if H[i]!=0:
                        ans_h = abs(X[i]-x)+abs(Y[i]-y)+H[i]
                else:
                    if ans_h-abs(X[i]-x)-abs(Y[i]-y)==H[i]:
                        pass
                    else:
                        done = True
            else:
                break

        if done == False:
            ans = (x,y,ans_h)
x,y,h = ans
print(x,y,h)


### FIXED CODE ###

#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
xyh = []
for i in range(N):
    x, y, h = LI()
    xyh.append([x, y, h])


"""

C_x C_y H

XYの高度はmax(H - abs(X - C_x) - abs(Y - C_y), 0)
"""
xyh = sorted(xyh, key=lambda xyh: xyh[2], reverse=True)

# print(xyh)
ans = (0,0,0)
for c_x in range(101):
    for c_y in range(101):
        H = 0
        flag = True
        for i, (x, y, h) in enumerate(xyh):
            if i == 0:
                H = h + abs(x - c_x) + abs(y - c_y)
            if h != max(H - abs(x - c_x) - abs(y - c_y), 0):
            # if H != max(h + abs(x - c_x) + abs(y - c_y), 0):
                flag = False
        if flag:
            ans = (c_x, c_y, H)
    
X, Y, H = ans
print(X, Y, H)
A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A=B:
  print(2*A)
else:
  print(2*B-1)

### FIXED CODE ###

A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A==B:
  print(2*A)
else:
  print(2*B-1)
t=input()
x=0
tl=list(t)
while x != -1:
    x=t.find("?")
    if tl[x+1]=="D":
        tl[x]="P"
    elif tl[x+1]=="?":
        tl[x]="P"
    else:
        tl[x]="D"
    t="".join(tl)
    x=t.find("?")
print(t)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
t=input()
tl=list(t)
tln=len(t)
x=0
for x in range(tln):
    if tl[x] == "?":
        if x == tln-1:
            tl[x]="D"
            break
        elif x==0:
            if tl[x+1]=="?":
                tl[x]="P"
                tl[x+1]="D"
            else:
                tl[x]="D"
        elif tl[x-1]=="P":
            tl[x]="D"
        elif tl[x+1]=="?":
            tl[x]="P"
            tl[x+1]="D"
        elif tl[x+1]=="D":
            tl[x]="P"
        else:
            tl[x]="D"
t="".join(tl)
print(t)
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
 
n = int(raw_input())
a = map(int, raw_input().split())
ans = min(map(how_many_times_divisible(), a))
 
print ans

### FIXED CODE ###

N = int(input())
A = [int(l) for l in input().split()]


count1 = 0
k = 0
while True:
  count2 = 0
  for i in range(N):
      if A[i]/2** k % 2 !=0:
        break
      else:
        count2 += 1
  if count2 == N:
    count1 += 1
  else:
    break
  k += 1

print(count1)
stack = [[] for i in xrange(int(raw_input()))]
while True:
	s = raw_input().split()
	if s[0] == 'quit':
		break
	elif s[0] == 'push':
		stack[int(s[1])-1].append(s[2])
	elif s[0] == 'pop':
		print stack[int(s[i])-1].pop()
	elif s[0] == 'move':
		stack[int(s[2])-1].append(stack[int(s[1])-1].pop())

### FIXED CODE ###

n = int(raw_input())
stack = [[] for i in xrange(n)]
while True:
	s = map(str,raw_input().split())
	if s[0] == 'quit':
		break
	elif s[0] == 'push':
		stack[int(s[1])-1].append(s[2])
	elif s[0] == 'pop':
		print stack[int(s[1])-1].pop()
	elif s[0] == 'move':
		stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
n, m = map(int, input().split())

root = [[] for _ in range(n)]

for i in range(m):
    x, y = map(int, input().split())
    root[x-1].append(y-1)

memo = ["empty" for _ in range(n)]

def dp(x):
    if memo[x] == "empty":
        res = 0
        for i in root[x]:
            res = max(res, dp(i)+1)
        memo[x] = res

    return memo[x]

for j in range(n):
    dp(j)

print(max(memo))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)

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

root = [[] for _ in range(n)]

for i in range(m):
    x, y = map(int, input().split())
    root[x-1].append(y-1)

memo = ["empty" for _ in range(n)]

def dp(x):
    if memo[x] == "empty":
        res = 0
        for i in root[x]:
            res = max(res, dp(i)+1)
        memo[x] = res

    return memo[x]

for j in range(n):
    dp(j)

print(max(memo))
x = int(input())
 
while True:
  flag ==0
  for i in range(2,x//2):
    if x%i==0:
      flag ==1
      break
  if flag ==1:
    print(x)
    exit()
  else:
    x = x+1

### FIXED CODE ###

x = int(input())
 
while True:
  flag =0
  for i in range(2,x//2):
    if x%i==0:
      flag =1
      break
  if flag ==0:
    print(x)
    exit()
  x = x+1
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)

n = int(input())
seen = [-1]*(n+1)
path = defaultdict(dict)

for _ in range(n-1):
    u, v, w = map(int, input().split())
    path[u][v] = w
    path[v][u] = w


def dfs(seen, pos, color):
    if seen[pos] != -1:
        return
    else:
        seen[pos] = color
        change_color = 1 - color
        for nx in path[pos].keys():
            check = path[pos][nx]
            if check % 2 == 1:
                dfs(seen, nx, change_color)
            dfs(seen, nx, color)


dfs(seen, 1, 0)
for i in range(1, n+1):
    print(seen[i])


### FIXED CODE ###

n, k = map(int, input().split())
S = list(input())
S[k-1] = S[k-1].lower()

print(''.join(S))
N = int(input())
A = list(map(int,input().split()))
B = [0]*N
C = [0]*N
for i in range(N):
    B[i] = i + 1 - A[i]
    C[i] = i + 1 + A[i]
B.sort()
C.sort()
K = [1]*300000
for i in B:
    K[i] *= 2
for i in C:
    K[i] *= 5
ans = 0
for i in K:
    p = 0
    q = 0
    if i%10 == 0:
        while i%2 == 0:
            i = i//2
            p += 1
        while i != 1:
            i = i//5
            q += 1
        ans += p*q
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = [0]*N
C = [0]*N
for i in range(N):
    B[i] = i + 1 - A[i]
    C[i] = i + 1 + A[i]
for i in range(N):
    if B[i] < 0:
        B[i] = 200001
    if C[i] > N:
        C[i] = 200001
K = [0]*200002
L = [0]*200002
for i in B:
    K[i] += 1
for i in C:
    L[i] += 1
M = [0]*200001
for i in range(200001):
    M[i] = K[i]*L[i]
print(sum(M))
N = int(input())
h = [int(_) for _ in input().split()] + [0]*N
dp = [float('inf')]*(N*N)
dp[0] = 0
dp[1] = abs(h[0]-h[1])

for i in range(N):
    dp[i+1] = min(dp[i+1], dp[i]+abs(h[i]-h[i+1]))
    dp[i+2] = min(dp[i+2], dp[i]+abs(h[i]-h[i+2]))

print(dp[N-1])

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
dp = [(10 ** 4) * N] * N
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, N):
    dp[i] = min(dp[i-2] + abs(h[i] - h[i-2]), dp[i-1] + abs(h[i] - h[i-1]))

print(dp[N-1])
import sys 
a = list(map(int,input().split()))

N = a[0]
M = a[1]

b = ['0']*N

for i in range(0,M):
    x = list(map(str,input().split()))
    if b[int(x[0])-1] != '0' and b[int(x[0])-1] != x[1]: #when the space which is tried to enter the number has a different value
        print('-1')
        sys.exit()
    elif x[0] == '1' and x[1] == '0':
        print('-1')
        sys.exit()
    else:
        b[int(x[0])-1] = x[1]

if b[0] == '0' and (int(b[1]) != 0 or int(b[2] != 0) ):
    b[0] = '1'

ans = ''.join(b)
print(ans)




### FIXED CODE ###

import sys 
a = list(map(int,input().split()))

N = a[0]
M = a[1]

b = ['0']*N

for i in range(0,M):
    x = list(map(str,input().split()))
    if b[int(x[0])-1] != '0' and b[int(x[0])-1] != x[1]: #既に与えられたところに違う値
        print('-1')
        sys.exit()
    elif N >= 2 and x[0] == '1' and x[1] == '0': #the first digit is  "0"
        print('-1')
        sys.exit()
    else:
        b[int(x[0])-1] = x[1]

if N != 1 and b[0] == '0':
    b[0] = '1'

ans = ''.join(b)
print(ans)
N,M = map(int,input().split())
L,R = map(int,input().split())
tmp = list(range(L,R+1))
for i in range(M-1):
  L,R = map(int,input().split())
  ans = []
  for j in tmp:
    if L<=j<=R:
      ans.append(j)
  tmp = ans
print(len(ans))

### FIXED CODE ###

N,M = map(int,input().split())
L,R = map(int,input().split())
for i in range(M-1):
  L_ans,R_ans = map(int,input().split())
  if L < L_ans:
    L = L_ans
  if R > R_ans:
    R = R_ans
print(len(list(range(L,R+1))))
def check(al,bl,cnt,i,j):

    if(i==len(al) or j==len(bl)):
        return cnt

    elif(j>i):
        c = check(al,bl,cnt,i+1,j)
        
    elif(al[i] > bl[j]) :
        al[i] = al[i]-bl[j]
        cnt += bl[j]
        c = check(al,bl,cnt,i,j+1)
    elif(al[i] < bl[j]):
        bl[j] = bl[j] - al[i]
        cnt += al[i]
        c= check(al,bl,cnt,i+1,j)
    elif(al[i] == bl[j]):
        cnt += al[i]
        c = check(al,bl,cnt,i+1,j+1)

    return c

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

cnt = 0

print(check(a,b,cnt,0,0))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

cnt = 0
res = 0 #余力
for i in range(n):

    ch = min(a[i],res)
    cnt += ch
    a[i] -= ch
    if b[i] > a[i]:
        cnt += a[i]
        res = b[i] - a[i]
    else:
        cnt += b[i]
        res = 0

cnt += min(a[n],res)

print(cnt)
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = [a for a in A if a <K]
N = len(A)
#dpm = [+1) for _ in range(N+1)]
dpm = [0]*(N+1)
dpm[0] = 1<<(K-1)
for i, a in enumerate(A):
    dpm[i+1] = dpm[i] | (dpm[i] >> a)

r = 0
dp2 = 1
for i, a in enumerate(A[::-1]):
    for j in range(a):
        if dp2 & tmp:
            break
        dpm[N-i-1] >>= 1
    else:
        r += 1
    dp2 |= dp2<<a
    dp2 &= (1<<K)-1
print(r)


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
A = [a for a in A if a <K]
N = len(A)
#dpm = [+1) for _ in range(N+1)]
dpm = [0]*(N+1)
dpm[0] = 1<<(K-1)
for i, a in enumerate(A):
    dpm[i+1] = dpm[i] | (dpm[i] >> a)

r = 0
dp2 = 1
for i, a in enumerate(A[::-1]):
    for j in range(a):
        if dp2 & dpm[N-i-1]:
            break
        dpm[N-i-1] >>= 1
    else:
        r += 1
    dp2 |= dp2<<a
    dp2 &= (1<<K)-1
print(r)
33
ABCCABCBABCCABACBCBBABCBCBCBCABCB

### FIXED CODE ###

N = int(input())
S = input()
ans = 0
for i in range(N-2):
    if S[i:i+3] == 'ABC':
       ans += 1 
print(ans)
a, b =map(int, open(0).read().split())
if a < b:
  c = 2 * b - 1
  print(c)
if a == b:
  c = 2 * a
  print(c)
else:
  c = 2 * a -1
  print(c)

### FIXED CODE ###

a, b, c =map(int, open(0).read().split())
if a == b and b == c:
  print(1)
elif a == b or b == c or a == c:
  print(2)
else:
  print(3)
a,b = input()
Z = a*b:
  print(Z)


### FIXED CODE ###

a,b =map(int,input().split())
if 1 <= a <=100 and 1 <= b <= 100:
     print(a*b)
s=input()
print(s[0]+str(len(S)-2)+s[-1])

### FIXED CODE ###

s=input()
print(s[0]+str(len(s)-2)+s[-1])
a,b,n = map(int, input().split())
if n < b:
    x = n
else:
    x = b-1
while x >= 0:
    val = (a*x)//b-a*(x//b)
    if val < com:
        pass
    else:
        com = val
    x -= 1
print(com)

### FIXED CODE ###

a,b,n = map(int, input().split())
com = 0
if n < b:
    x = n
else:
    x = b-1
val = (a*x)//b
print(val)
a,b,c = map(input().split())
ans = 'A' + b[0] + 'C'
print(ans)

### FIXED CODE ###

a,b,c = map(str,input().split())
ans = 'A' + b[0] + 'C'
print(ans)
a,b = map(int, input().split())

ans = 0
A = 1
while A < b:
  ans += 1
  s += (a - 1)
print(ans)


### FIXED CODE ###

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

ans = 0
A = 1
while A < b:
  ans += 1
  A += (a - 1)
print(ans)
n = int(inputs[0])
D = list(map(int, inputs[1].split()))

if (D[0] != 0):
    print(0)
else:
    c = Counter(D)
    if (c[0] > 1):
        print(0)
    else:
        ans = 1
        for i in range(1,max(D)+1):
            ans *= c[i-1]**c[i]
        print(ans % 998244353)

### FIXED CODE ###

from collections import Counter
inputs = open(0).readlines()

n = int(inputs[0])
*D, = map(int, inputs[1].split())
mod = 998244353

nbs = [0] * (max(D)+1)
for k, v in Counter(D).items():
    nbs[k] = v

if D[0] != 0 or nbs[0] != 1:
    print(0)
else:
    ans = 1
    for n0, n1 in zip(nbs, nbs[1:]):
        ans = ans * pow(n0, n1, mod) % mod
    print(ans)
N, M, K = map(int, input().split())


def power_func(a,n,p):
    bi = str(format(n,"b"))#2進表現に
    res = 1
    for i in range(len(bi)):
        res = (res*res) % p
        if bi[i] == "1":
            res = (res*a) % p
    return res

P = 998244353
inv_t = [0] + [1]
for i in range(2, N+2):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

ans = (M * power_func(M-1, N-1, P))%P
curr = ans
for k in range(K):
    N-k-1 < 0 : break
    curr = (curr*(N-k-1)*inv_t[k+1]*inv_t[M-1]) % P
    ans += curr
    ans %= P

print(ans)

### FIXED CODE ###

import sys
N, M, K = map(int, input().split())

if M == 1 :
    if K == N-1:
        print(1)
    else:
        print(0)
    sys.exit()

def power_func(a, n, p):
    bi = str(format(n,"b"))#2進表現に
    if a == 0:
        return 0
    res = 1
    for i in range(len(bi)):
        res = (res*res) % p
        if bi[i] == "1":
            res = (res*a) % p
    return res

P = 998244353
inv_t = [0] + [1]
for i in range(2, max(M,K)+2):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

ans = (M * power_func(M-1, N-1, P))%P
curr = ans
for k in range(K):
    curr = (curr*(N-k-1)*inv_t[k+1]*inv_t[M-1]) % P
    ans += curr
    ans %= P

print(ans)
#! /usr/bin/env python3

def main():
    d = 10 ** 9 + 7
    ans = 1
    N = int(input())
    T = list(map(int, input().split()))
    A = list(map(int, input().split()))
    L = len(T)
    ST = [T[0]] + [0] * (L-2) + [T[-1] if T[-1] != T[-2] else 0]
    SA = [A[0] if A[0] != A[1] else 0] + [0] * (L-2) + [A[-1]]
    for i in range(0, L-1):
        if T[i] == T[i-1] and A[i] == A[i+1]:
            ans = (ans * min(T[i], A[i])) % d
        else:
            if T[i] != T[i-1] : ST[i] = T[i]
            if A[i] != A[i+1] : SA[i] = A[i]
    mt = ma = 0
    for i in range(L):
        ma = max(ma, SA[i])
        mt = max(mt, ST[L-i-1])
        if ST[i] and SA[i] and ST[i] != SA[i]:
            ans = 0
        if (ST[i] and ST[i] < ma) or (SA[-i-1] and SA[-i-1] < mt):
            ans = 0
    print(ans)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

c = 0
f = 0
for i in input():
    if i == 'C' : c = 1
    if c and i == 'F':
        f = 1
        break
print( 'Yes' if c + f > 1 else 'No')
n,m,k = map(int, input().split())
a_li = list(map(int, input().split()))
b_li = list(map(int, input().split()))

a_li = [0] + a_li
b_li = [0] + b_li

time = 0
ans = 0
a = 0
temp = 0

a_wa = [0] * (n+10)
b_wa = [0] * (m+10)

s = 0
for i in range(n+1):
    s += a_li[i]
    a_wa[i] = s

s = 0
for i in range(m+1):
    s += b_li[i]
    b_wa[i] = s
    

for i in range(n+1):
    for j in range(min(ans-i-1, m), m+1):
        time = a_wa[i] + b_wa[j]
        if time <= k:
            ans = max(ans, i+j)
        else:
            break
            
print(ans)

### FIXED CODE ###

n,m,k = map(int, input().split())
a_li = list(map(int, input().split()))
b_li = list(map(int, input().split()))

a_li = [0] + a_li
b_li = [0] + b_li

time = 0
ans = 0
a = 0
temp = 0

a_wa = [0] * (n+10)
b_wa = [0] * (m+10)

s = 0
for i in range(n+1):
    s += a_li[i]
    a_wa[i] = s

s = 0
for i in range(m+1):
    s += b_li[i]
    b_wa[i] = s
    

for i in range(n+1):
    for j in range(max(min(temp-i, m), 0), m+1):
        time = a_wa[i] + b_wa[j]
        if time <= k:
            ans = max(ans, i+j)
            temp = ans
        else:
            break
            
print(ans)
# -*- coding: utf-8 -*-
a = int(input())
judge = True
for i in range(a):
  b = int(input())
  if (b % 2 == 0) and ((b % 3 != 0) or (b % 5 != 0)):
    judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

### FIXED CODE ###

# -*- coding: utf-8 -*-
a = int(input())
lis = list(map(int, input().split()))
for i in range(a):
  judge = True
  if (lis[i] % 2 == 0):
    if (lis[i] % 3 != 0) and (lis[i] % 5 != 0):
      judge = False
      break
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")
a,b,c = map(int, input())

print(c,a,b)

### FIXED CODE ###

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

print(c,a,b)
taxs = input().split(" ")
 
a = int(taxs[0])
b = int(taxs[1])
 
product_min = int(a / 0.08)
product_max = int((a+1) / 0.08)

for product in range( product_min, product_max ):
	bpred = int(product * 0.1)
	if( bpred == b ):
  		print( product )
        break

print( -1 )

### FIXED CODE ###

taxs = input().split(" ")
 
a = int(taxs[0])
b = int(taxs[1])
 
product_min = int(a / 0.08 + 0.5)
product_max = int((a+1) / 0.08)

setflg = 0
for product in range( product_min, product_max ):
  bpred = int(product * 0.1)
  if( bpred == b ):
    print( product )
    setflg=1
    break

if setflg==0:
  print( -1 )
n = int(input())
A = [int(input()) for i in range(n)]
 
B = set()
lenB = 0
for a in A:
    if a in B:
        B.remove(a)
        lenB -= 1
    else:
        b.add(a)
        lenB += 1
print(lenB)

### FIXED CODE ###

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

b = set()
lenB = 0
for a in A:
    b.add(a)
    lenB += 1
    if len(b) != lenB:
        b.remove(a)
        lenB -= 2
print(len(b))
n = int(input())

if n > 10:
    print(n)
else:
    R = 100*(10 - n)
    print(R)

### FIXED CODE ###

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

if a >= 10:
    print(b)
else:
    print(b + 100*(10 - a))
N, M = map(int, input().split())

class DisjointSetUnion():
    def __init__(self, n):
        self.n = n
        self.par_size = [-1] * n

    def merge(self, a, b):
        #assert 0 <= a < self.n
        #assert 0 <= b < self.n
        x = self.leader(a)
        y = self.leader(b)
        if x == y: return x
        if -self.par_size[x] < -self.par_size[y]: x, y = y, x
        self.par_size[x] += self.par_size[y]
        self.par_size[y] = x
        return x

    def same(self, a, b):
        #assert 0 <= a < self.n
        #assert 0 <= b < self.n
        return self.leader(a) == self.leader(b)

    def leader(self, a):
        #assert 0 <= a < self.n
        x = a
        while self.par_size[x] >= 0:
            x = self.par_size[x]
        while self.par_size[a] >= 0:
            self.par_size[a] = x
            a = self.par_size[a]
        return x

    def size(self, a):
        #assert 0 <= a < self.n
        return -self.par_size[self.leader(a)]

    def groups(self):
        leader_buf = [0] * self.n
        group_size = [0] * self.n
        res = [[] for _ in range(self.n)]
        for i in range(self.n):
            leader_buf[i] = self.leader(i)
            group_size[leader_buf[i]] += 1
        for i in range(self.n):
            res[leader_buf[i]].append(i)
        res = [res[i] for i in range(self.n) if res[i]]
        return res

uf = DisjointSetUnion(N)

for _ in range(M):
    a, b = map(int, input().split())
    uf.merge(a, b)

l = len(uf.groups())
print(l - 1)

### FIXED CODE ###

N, M = map(int, input().split())

class DisjointSetUnion():
    def __init__(self, n):
        self.n = n
        self.par_size = [-1] * n

    def merge(self, a, b):
        #assert 0 <= a < self.n
        #assert 0 <= b < self.n
        x = self.leader(a)
        y = self.leader(b)
        if x == y: return x
        if -self.par_size[x] < -self.par_size[y]: x, y = y, x
        self.par_size[x] += self.par_size[y]
        self.par_size[y] = x
        return x

    def same(self, a, b):
        #assert 0 <= a < self.n
        #assert 0 <= b < self.n
        return self.leader(a) == self.leader(b)

    def leader(self, a):
        #assert 0 <= a < self.n
        x = a
        while self.par_size[x] >= 0:
            x = self.par_size[x]
        while self.par_size[a] >= 0:
            self.par_size[a] = x
            a = self.par_size[a]
        return x

    def size(self, a):
        #assert 0 <= a < self.n
        return -self.par_size[self.leader(a)]

    def groups(self):
        leader_buf = [0] * self.n
        group_size = [0] * self.n
        res = [[] for _ in range(self.n)]
        for i in range(self.n):
            leader_buf[i] = self.leader(i)
            group_size[leader_buf[i]] += 1
        for i in range(self.n):
            res[leader_buf[i]].append(i)
        res = [res[i] for i in range(self.n) if res[i]]
        return res

uf = DisjointSetUnion(N)

for _ in range(M):
    a, b = map(int, input().split())
    uf.merge(a - 1, b - 1)

l = len(uf.groups())
print(l - 1)
A,B=map(int,input().split())
if A-K==-(B-K):
  print(K)
else:
  print("IMPOSSIBLE")


### FIXED CODE ###

A,B=map(int,input().split())
if (A+B)%2==0:
  print((A+B)//2)
else:
  print("IMPOSSIBLE")
x = int(input())
kosuu, amari = x // 100, x % 100
ans = 0

for i in kosuu:
    amari -= 5
    if amari <= 0:
        ans = 1
        break

print(ans)

### FIXED CODE ###

x = int(input())
kosuu, amari = x // 100, x % 100
ans = 0

for i in range(kosuu):
    amari -= 5
    if amari <= 0:
        ans = 1
        break

print(ans)
N = input()
digitsum_N = 0

for i in N:
  digitsum_N += int(i)
  
print("Yes" if N % digitsum_N == 0 else "No")

### FIXED CODE ###

N = input()
digitsum_N = 0

for i in N:
  digitsum_N += int(i)
  
print("Yes" if int(N) % digitsum_N == 0 else "No")