Harryxun/stf_run huggingface dataset:
import math
n=int(input())
a=list(map(int,input().split()))
soin = [0]*(10**5+1)


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            while temp % i == 0:
                temp //= i
            arr.append(i)

    if temp != 1:
        arr.append(temp)

    if arr == []:
        arr.append(n)

    return arr


if len(a)>78498:
    ans=a[0]
    for i in a:
        ans=math.gcd(ans,i)
    if ans==1:
        print("setwise coprime")
    else:
        print("not coprime")
else:
    for i in a:
        for num in factorization(i):
            soin[num]+=1
    if max(soin)==1:
        print("pairwise coprime")
    elif max(soin)==n:
        print("not coprime")
    else:print("setwise coprime")


### FIXED CODE ###

import math
n=int(input())
a=list(map(int,input().split()))
soin = [0]*(10**6+1)
if a.count(1)==n:
    print("pairwise coprime")
    exit()

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            while temp % i == 0:
                temp //= i
            arr.append(i)

    if temp != 1:
        arr.append(temp)

    if arr == []:
        arr.append(n)

    return arr


if len(a)>80000:
    ans=a[0]
    for i in a:
        ans=math.gcd(ans,i)
    if ans==1:
        print("setwise coprime")
    else:
        print("not coprime")
else:
    for i in a:
        if i ==1:continue
        for num in factorization(i):
            soin[num]+=1
    if max(soin)==1:
        print("pairwise coprime")
    elif max(soin)==n and 1 not in a:
        print("not coprime")
    else:print("setwise coprime")
import sys
input = sys.stdin.readline

a, b = input().split()
print("Odd" if (a*b) % 2 == 0 else "Even")

### FIXED CODE ###

import sys
input = sys.stdin.readline

a, b = map(int, input().split())
print("Even" if (a*b) % 2 == 0 else "Odd")
n = int(input())
num = list(map(int,input().split()))
for i in range(n):
    print(num[n-i-1],end = " ")

### FIXED CODE ###

n =int(input())
a = list(map(int,input().split()))
a.reverse()
for i in range(n):
    if i!=n-1:
        print(a[i],end=" ")
    else:
        print(a[i])
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(m)]
class UnionFind(object):
    def __init__(self, size):
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]


    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])


    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)
def C(x):
    U=UnionFind(n)
    for i in range(m):
        if i==x:
            continue
        U.unite(ab[i][0]-1, ab[i][1]-1)
    for i in range(n):
        for j in range(m):
            if not U.same(i, j):
                return False
    return True
ans=0
for x in range(m):
    if not C(x):
        ans+=1
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(m)]
class UnionFind(object):
    def __init__(self, size):
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]


    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])


    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)
def C(x):
    U=UnionFind(n)
    for i in range(m):
        if i==x :
            continue
        U.unite(ab[i][0]-1, ab[i][1]-1)
    for i in range(n):
        for j in range(n):
            if not U.same(i, j):
                return False
    return True
ans=0
for y in range(m):
    if not C(y):
        ans+=1
print(ans)
import sys
import numpy as np

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N, K = rl()
A = np.array([0] + rl())
A_cum = A.cumsum()
A_cum2 = A_cum - np.arange(N+1)
A_cum2 = A_cum2 % K
answer = 0
remain = [0] * (K)
cnt = 0
for i in range(N+1):
    x = A_cum2[i] % K    
    if i - K >= 0:
        y = A_cum2[i-K] % K
        remain[y] -= 1
    answer += remain[x]
    remain[x] += 1
print(answer)

### FIXED CODE ###

import sys
import numpy as np
from collections import defaultdict

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
A = np.array([1] + lr())
A = (A-1) % K
N += 1
Acum = (A.cumsum() % K).tolist()
d = defaultdict(int)
answer = 0
for i, x in enumerate(Acum):
    answer += d[x]
    d[x] += 1
    if i >= K-1:
        d[Acum[i-(K-1)]] -= 1

print(answer)
A = input()
for a in range(3):
  if A[a] == '7':
    print(yes)
    break
  if a == 2:
    print('No')

### FIXED CODE ###

A = input()
for a in range(3):
  if A[a] == '7':
    print('Yes')
    break
  if a == 2:
    print('No')
# to enable variable use in global
global tree, point

# v : current node, f : parent node 
def dfs(v, f):
    for next_v in tree[v]:
        if next_v == f:
            continue
    
        point[next_v] += point[v]
        dfs(next_v, v)

n, q = list(map(int,input().split()))
# initialize global variables
tree = [[]*n for i in range(200010)]
point = [0] * n

for _ in range(n-1):
    a, b = list(map(int, input().split()))

    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

for _ in range(q):
    p, x = list(map(int, input().split()))

    point[p-1] += x

dfs(0, 0)
print(*point)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

# to enable variable use in global
global tree, point

# v : current node, f : parent node 
def dfs(v, f):
    global tree, point
    for next_v in tree[v]:
        if next_v == f:
            continue
    
        point[next_v] += point[v]
        dfs(next_v, v)

n , q = map(int, input().split())
tree = [[] for _ in range(n)]
point = [0] * n
for _ in range(n - 1):
    a , b = map(int,input().split())
    tree[b - 1].append(a - 1)
    tree[a - 1].append(b - 1)

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

dfs(0, 0)
print(*point)
h, w = map(int,input().split())
grids = []
for i in range(h):
    grids.append(input())
    
start = []
for i in range(len(grids)):
    if "@" in grids[i]:
        start = [i, grids[i].index("@")]

if len(start) == 0:
    quit
    
queue = [start]
check = []
ans = "No"
while len(queue) != 0:
    x, y = queue[0][0], queue[0][1]
    queue.pop(0)

    if x > 0:
        if grids[x-1][y] == "#" and [x-1, y] not in check:
            queue.append([x-1, y])
            check.append([x-1, y])
    if x < h-1:
        if grids[x+1][y] == "#" and [x+1, y] not in check:
            queue.append([x+1, y])
            check.append([x+1, y])
    if y > 0:
        if grids[x][y-1] == "#" and [x, y-1] not in check:
            queue.append([x, y-1])
            check.append([x, y-1])
    if y < w-1:
        if grids[x][y+1] == "#" and [x, y+1] not in check:
            queue.append([x, y+1])
            check.append([x, y+1])

cnt = 0
for grid in grids:
    cnt += grid.count("#")
    
if cnt == len(check):
    ans = "Yes"
print(ans)


### FIXED CODE ###

H,W = map(int, input().split())
s = []
answer = "Yes"

for i in range(H):
    s.append(str(input()))

for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            if j != 0 and s[i][j-1] == ".":
                if j+1 != W and s[i][j+1] == ".":
                    if i != 0 and s[i-1][j] == ".":
                        if i+1 != H and s[i+1][j] == ".":
                            answer ="No"

print(answer)
#import ascii
#def ctoi(ch):
#	return ch - 97

def itoc(i):
	return chr(i+97)
s = raw_input()
s = map(lambda x: ord(x) - 97, s)
K = input()
N = len(s)
#print("s", s)
for i in range(N):
	if s[i] + K <= 25:
		pass
	elif s[i] != 0:
		K = K - (25 - s[i]) - 1
		s[i] = 0
	else:
		pass
	if K == 0:
		break
#print(s)
#print(K)

for i in range(N-1, -1, -1):
	if s[i] + K <= 25:
		s[i] = s[i] + K
		K = 0
		break
	else:
		K = K - (26 - s[i])
		s[i] = 0
#print(K)
tmp = [itoc(item) for item in s]
print("".join(tmp))



### FIXED CODE ###

l = raw_input()
print(l[:4]+" "+l[4:])
N = int(input())
A = sorted([int(x) for x in input().split()])

def check():
    if N % 2 == 0:
        for i in range(1,N)[::2]:
            if A[i-1] != i or A[i] != i:    return 0
        return int(2**(N/2)) % (1e9+7)
    else:
        if A[0] != 0:   return 0
        else:
            for i in range(2,N)[::2]:
                if A[i-1] != i or A[i] != i:    return 0
            return int(2**((N-1)/2)) % int(1e9+7)
        
print(int(check()))


### FIXED CODE ###

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

def check():
    if N % 2 == 0:
        for i in range(1,N)[::2]:
            if A[i-1] != i or A[i] != i:    return 0
        return int(2**(N//2)) % int(1e9+7)
    else:
        if A[0] != 0:   return 0
        else:
            for i in range(2,N)[::2]:
                if A[i-1] != i or A[i] != i:    return 0
            return int(2**((N-1)//2)) % int(1e9+7)
        
print(check())
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(9)]
for j in range(n):
  l[a[j]//400]+=1
c=0
for k in range(len(l)-1):
  if l[k]>0:c+=1
print(c,c+l[8])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(9)]
for j in range(n):
  l[min(a[j],3200)//400]+=1
c=0
for k in range(len(l)-1):
  if l[k]>0:c+=1
if c==0:print(1,c+l[8])
else:print(c,c+l[8])
# N: number of balls to take, A: blue, B: red
    N, A, B = list(map(int, input().split()))

    if N == 0:
        print(0)

    if A + B < N:
        # want to know how much A + B blocks can we place such that A + B < N (i.e. solve x(A+B) < N)
        blocks = int(N/(A+B))
        # for each block, there are A blue balls, plus potentially some reamining slots to fill the remaining space of N
        remaining_slots = N % (A+B)
        if A <= remaining_slots:
            # if it can fit A, place A more balls in the row
            print(blocks*A + A) 
        else:
            print(blocks*A + remaining_slots)
    else:
        if A + B == N:
            print(A)
        else:
            print(A-N)

### FIXED CODE ###

# N: number of balls to take, A: blue, B: red
N, A, B = list(map(int, input().split()))

if N == 0:
    print(0)

if A + B < N:
    # want to know how much A + B blocks can we place such that A + B < N (i.e. solve x(A+B) < N)
    blocks = int(N/(A+B))
    # for each block, there are A blue balls, plus potentially some reamining slots to fill the remaining space of N
    remaining_slots = N % (A+B)
    if A <= remaining_slots:
        # if it can fit A, place A more balls in the row
        print(blocks*A + A) 
    else:
        print(blocks*A + remaining_slots)
else:
    if A < N:
        print(A)
    else:
        print(N)
a,b,c = list(map(int,input().split()))
temp = 0 
if a > b:
    temp = a
	a = b
	b = temp
if b > c:
	temp = b
	b = c
	c = temp
if a > b:
	temp = a
	a = b
	b = temp
print(a,b,c)

### FIXED CODE ###

num = list(map(int, input().split()))

num.sort()

print(num[0], num[1], num[2])
import math
n, p = map(int, input().split())
cnt = [0] * math.ceil(math.sqrt(p))
ans = 1
for i in range(2, math.ceil(math.sqrt(p))):
    cnt = 0
    while p % i == 0 and p != 0:
        p //= i
        cnt[i] += 1
    ans *= i ** (cnt[i] // n)
ans *= p ** (1 // n)
print(ans)

### FIXED CODE ###

import math
n, p = map(int, input().split())
cnt = [0] * math.ceil(math.sqrt(p))
tmp = p
for i in range(2, math.ceil(math.sqrt(p))):
    while p % i == 0 and p != 0:
        p //= i
        cnt[i] += 1
ans = 1
for i in range(2, math.ceil(math.sqrt(tmp))):
    ans *= i ** (cnt[i] // n)
ans *= p ** (1 // n)
print(ans)
n,m = map(int,input().split())
if n == 1:
  if m == 1:
    print(1)
  elif m == 2:
    print(0)
  else:
    print(m-2)
elif m == 1:
  elif n == 2:
    print(0)
  else:
    print(n-2)
else:
  print(n*m-(n*2+m*2-4))

### FIXED CODE ###

n,m = map(int,input().split())
if n == 1:
  if m == 1:
    print(1)
  elif m == 2:
    print(0)
  else:
    print(m-2)
elif m == 1:
  if n == 2:
    print(0)
  else:
    print(n-2)
else:
  print(n*m-(n*2+m*2-4))
import math
x, y = map(int, input().split())
def lcm(x,y):
    return (x * y)//math.gcd(x, y)

def thingo(x,y):
    if (x == 0 and y == 0):
        return -1
    if (x != 0 and y == 0):
        return x
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))


### FIXED CODE ###

b=[]
b = input().strip().split()
b[0]=int(b[0])
b[1]=int(b[1])
if b[0]%b[1]==0:
	print("-1")
else:
	print(b[0])
s=input()
t=list(input())

from collections import Counter

S=Counter(s)
T=Counter(t)

for a in T.keys():
    if not a in S.keys():
        print(-1)
        exit()

Ls=len(s)
Lt=len(t)

from collections import deque

abc="abcdefghjijklmnopqrstuvwxyz"
pos=[[] for _ in range(26)]
for i in range(Ls):
    ch=s[i]
    idx=abc.index(ch)
    pos[idx].append(i)

Ns=[]
now=0
for i in range(Lt):
    ch=t[i]
    idx=abc.index(ch)
    if pos[idx][-1]<now:
        Ns.append(pos[idx][0])
        now=pos[idx][0]
        continue
    l=0
    r=len(pos[idx])
    while l+1<r:
        mid=(l+r)//2
        if pos[idx][mid]<=now:
            l=mid
        else:
            r=mid
    Ns.append(pos[idx][l])
    now=pos[idx][l]

cnt=0
for i in range(1,Lt):
    if Ns[i-1]>=Ns[i]:
        cnt+=1
print(cnt*Ls+Ns[-1]+1)



### FIXED CODE ###

s=input()
t=input()

pos=[[] for _ in range(26)]

len_s=len(s)
len_t=len(t)


for i in range(len_s):
    idx=ord(s[i])-97
    pos[idx].append(i)

ans=[]
tmp=-1
cnt=0
for i in range(len_t):
    idx=ord(t[i])-97
    if len(pos[idx])==0:
        print(-1)
        exit()

    if tmp<pos[idx][-1]:
        l=-1
        r = len(pos[idx]) - 1
        while l + 1 < r:
            mid = (l + r) // 2
            if pos[idx][mid] <= tmp:
                l = mid
            else:
                r=mid
        ans.append(pos[idx][r])
        tmp=pos[idx][r]
    else:
        cnt+=1
        ans.append(pos[idx][0])
        tmp=pos[idx][0]


print(cnt*len_s+ans[-1]+1)
S, T= input().split()
A, B= map(int, input().split())
U= input().split()
 
if (S==U):
    print(A-1,B)
else if (T==U):
    print(A,B-1)
else:
    print(A,B)

### FIXED CODE ###

S, T= input().split()
A, B= map(int, input().split())
U= input()
if (S == U):
    print(A-1,B)
elif (T == U):
    print(A,B-1)
else:
    print(A,B)
import numpy as np

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

K_str = format(K, 'b')
max_order = len(K_str)

B = np.array([list(format(a, '0{}b'.format(10)))
              for a in A]
             ).astype('i')[:, :max_order]
B = B.sum(axis=0)
B = np.where(B < N/2, 1, 0)

X_str = ''.join(map(str, B))
X = int(X_str, 2)

print(sum(map(lambda a: X ^ a, A)))


### FIXED CODE ###

import numpy as np

N, K = [int(a) for a in input().split()]
A = [int(a) for a in input().split()]

K = format(K, 'b')
B = [format(a, 'b') for a in A]
max_order = len(max(B + [K], key=len))

K = K.zfill(max_order)
B = np.array([list(b.zfill(max_order)) for b in B], dtype='i')
B = B.sum(axis=0)
B = np.where(B < N/2, '1', '0')

for i, k, b in zip(range(max_order), K, B):
    if k < b:
        B[i] = '0'
    elif k > b:
        break

X = int(''.join(map(str, B)), 2)

print(sum(map(lambda a: X ^ a, A)))
lis = list(map(int, input().split()))
n = lis[0]
k = lis[1]
a = []
b = []
for i in range(n):
	if lis[i] not in a
		a.append(lis[i])
		count = 0
		for j in range(i+1,n)
			if lis[j] == lis[i]
				count += 1
		b.append(count)
if len(b) <= k
	print(0)
else:
	b.sort()
	b.reserve()
	swap = 0
	for i in range(k,len(b))
		swap += b[i]
	print(swap)


### FIXED CODE ###

lis = list(map(int, input().split()))
lis2 = input().split()
n = lis[0]
k = lis[1]
d = {}

for i in range(n):
    if lis2[i] not in d.keys():
       d[lis2[i]] = 1
    else:
        d[lis2[i]] += 1 
        
if len(list(d.values())) <= k:
    print(0)
else:
    a = list(d.values())
    a.sort()
    a.reverse()
    swap = 0
    for i in range(k,len(a)):
        swap += a[i]
    print(swap)
n = int(input())
_a = list(map(int, input().split()))
a = {}
for i in range(n):
    if _a[i] in a:
        a[_a[i]] += 1
    else:
        a[_a[i]] = 1
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    if b in a:
        if c not in a:
            a[c] = 0
        tmp = a[b]
        a[c] += tmp
        a[b] = 0
        sum_ = 0
        for k in a:
            sum_ += k * a[k]
    print(sum_)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
q = int(input())
total = sum(a)
dct = {}
for i in range(n):
    if a[i] in dct:
        dct[a[i]] += 1
    else:
        dct[a[i]] = 1

for i in range(q):
    b, c = map(int, input().split())
    if b not in dct: dct[b] = 0
    if c not in dct: dct[c] = 0
    total += dct[b] * (c - b)
    print(total)
    
    dct[c] += dct[b]
    dct[b] = 0
a=input()
b=list(a)
c=1
x=0
ans={"L":1,"R":0,"U":0,"D":0}
ans2={"L":0,"R":1,"U":0,"D":0}
for i in b:
	if int(c)%2==1:
    	x=x+ans[i]
    elif int(c)%2==0:
      	x=x+ans2[i]
    c=c+1
if x>=1:
	print("No")
else:
  	print("Yes")
	
	

### FIXED CODE ###

a=input()
b=list(a)
c=1
x=0
ans={"L":1,"R":0,"U":0,"D":0}
ans2={"L":0,"R":1,"U":0,"D":0}
for i in b:
    if int(c)%2==1:
        x=x+ans[i]
    elif int(c)%2==0:
        x=x+ans2[i]
    c=c+1
if x>=1:
	print("No")
else:
  	print("Yes")
n= sort(list(int,input().split()))
if n == [1,7,9,4]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

n= list(map(int,input().split()))
n.sort()
if 1 in n and 7 in n and 9 in n and 4 in n:
  print("YES")
else:
  print("NO")
n=int(input())
arr = list(map(float,input().split()))
dp = [[-1]*(3001) for i in range(3001)]

def func(n,x):
    if x==0:
        return 1
    if dp[n][x]>-0.9:
        return dp[n][x]  
    if n==0:
        return 0
    
    dp[n][x] = (arr[n-1])*func(n-1,x-1) + (1-arr[n-1])*func(n-1,x)
    return dp[n][x]

print("%0.10f"%func(n,(n+1)//2))


### FIXED CODE ###


n=int(input())
arr = list(map(float,input().split()))
dp = [[-1]*(n+1) for i in range(n+1)]
def func(n,x):
    for i in range(0,n+1):
        for j in range(0,n+1):
            if j==0:
                dp[i][j] = 1
            elif i==0:
                dp[i][j]=0
            else:
                p=(arr[i-1])*dp[i-1][j-1]
                q=(1-arr[i-1])*dp[i-1][j]
                dp[i][j] = p+q 
    
    return dp[n][x]

print("%0.10f"%func(n,(n+1)//2))
N,K,Q = map(int,input().split())
a = [0 for i in range(N)]
for i in range(Q):
  a[int(input())-1]+=1
for i in range(a):
  if K-Q+i>0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

N,K,Q = map(int,input().split())
a = [0 for i in range(N)]
for i in range(Q):
  a[int(input())-1]+=1
for i in a:
  if K-Q+i>0:
    print("Yes")
  else:
    print("No")
def resolve():

    d, g = map(int, input().split())

    p = [0] * d
    c = [0] * d

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

    ans = 1010

    for i in range(d ** 2):

        sum = 0
        cnt = 0

        for j in range(d):

            if (i >> j) & 1:

                sum += (j + 1) * 100 * p[j]
                sum += c[j]

                cnt += p[j]

        if sum < g:

            for k in range(d)[::-1]:

                flag = 0

                if not (i >> k) & 1:

                    for _ in range(p[k] -1):

                        if sum >= g:
                            flag = 1
                            break

                        sum += (k+1) * 100
                        cnt += 1

                if flag:
                    break

        if sum >= g:
            ans = min(cnt, ans)

    print(ans)
    
resolve()

### FIXED CODE ###

n = int(input())
if n < 1200:
  print('ABC')
elif n < 2800:
  print('ARC')
else:
  print('AGC')
n = int(input())
unsorted_blocks = []
for i in range(n):
    w_str, s_str, v_str = input().split(" ")
    w, s, v = int(w_str), int(s_str), int(v_str)
    unsorted_blocks.append({"w": w, "s": s, "v": v})

blocks = sorted(unsorted_blocks, key=lambda block: unsorted_blocks["s"]) 

def dp(blocks, max_s):
    max_val = 0
    for i in range(len(blocks)):
        taken =  blocks[i]

        # klo constraint nya
        new_max_s = 0
        if max_s is None:
            new_max_s = taken["s"]
        else:
            new_max_s = min(max_s-taken["w"], taken["s"])

        # ini constraint nya
        if new_max_s < 0:
            continue

        # remaining blocks, taruh sini, biar ga diitung kalau jelas ga mungkin
        remaining_blocks = [blocks[x] for x in range(len(blocks)) if x != i and blocks[x]["w"] <= new_max_s]

        # ini nilai tambahan
        taken_val = taken["v"]
        new_val = taken_val + dp(remaining_blocks, new_max_s)
        if new_val > max_val:
            max_val = new_val

    return max_val

print(dp(blocks, None))

### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
N = int(input())
WSV = list(tuple(map(int, input().split())) for _ in range(N))
WSV.sort(key=lambda x: x[0] + x[1])
U = 2 * 10 ** 4 + 100
dp = np.zeros(U, dtype=np.int64)
for w, s, v in WSV:
    dp[w:w+s+1] = np.maximum(dp[w:w+s+1], dp[:s+1] + v)
print(dp.max())
from fractions import gcd
from functools import reduce
n,x=map(int,input().split())
y=list(map(int,input().split()))
def gcd(num):
    return reduce(fractions.gcd, num)
ya=[abs(y[i]-x) for i in range(n)]
print(gcd(ya))

### FIXED CODE ###

import fractions
from functools import reduce
n,x=map(int,input().split())
y=list(map(int,input().split()))
def gcd(num):
    return reduce(fractions.gcd, num)
ya=[abs(y[i]-x) for i in range(n)]
print(gcd(ya))
k = int(input())
a,b = map(int,input().split())
for i in range(a,b):
  if i % k == 0:
    ans = 'OK'
    break
  else:
    ans = 'No'
print(ans)

### FIXED CODE ###

k = int(input())
a, b = map(int, input().split())
p = a % k
q = k - p
if (p == 0) or ((a + q) <= b):
    print('OK')
else:
    print('NG')
h,w=map(int,input().split())
s=[input() for i in range(h)]

for i in range(h):
    for j in range(w):
        c=0
        for a in range(i-1,i+2):
            for b in range(j-1,j+2):
                c+=all((min(a,b)>=0,a<h,b<w))and s[a][b]=='#'
        if s[i][j]=='.':s[i][j]=c

for a in s:
    print(*a,sep='')

### FIXED CODE ###

h,w=map(int,input().split())
s=[input() for _ in range(h)]
 
for i in range(h):
    ans=""
    for j in range(w):
        if(s[i][j]=="#"):
            ans+="#"
        else:
            tmp=0
            for k in s[max(0, i-1):min(h, i+2)]:
                tmp+=k[max(0, j-1):min(w, j+2)].count("#")
                
            ans+=str(tmp)
    print(ans)
num_line=input().rstrip().split(" ")
num=int(num_line[0])
a=int(num_line[1])
b=int(num_line[2])

allcase=pow(2,num,1000000007)-1
#print(allcase)

abunshi=1
for i in range(num-a+1,num+1):
    abunshi*=i
#print(abunshi)

abumbo=1
for i in range(1,a+1):
    abumbo*=i
#print(abumbo)

abumbo=pow(abumbo,1000000005,1000000007)
#print(abumbo)

aminus=abunshi*abumbo%1000000007
#print(aminus)

bbunshi=1
for i in range(num-b+1,num+1):
    bbunshi*=i
#print(bbunshi)

bbumbo=1
for i in range(1,b+1):
    bbumbo*=i
#print(bbumbo)

bbumbo=pow(bbumbo,1000000005,1000000007)
#print(bbumbo)

bminus=bbunshi*bbumbo%1000000007
#print(bminus)

print(allcase-aminus-bminus)


### FIXED CODE ###

time_line = input().rstrip().split(" ")
time_a = int(time_line[0])
time_b = int(time_line[1])

if time_a<10:
    hosei=(10-time_a)*100
    
else:
    hosei=0

kekka=time_b+hosei
print(kekka)