Harryxun/stf_run huggingface dataset:
a,b,c,d,e,f= map(int, input().split())
youeki=0
yousitu=0
noudo=0
n_a=int(f/(100*a))


for i in range(2+n_a):
 for j in range(2+int((f-100*i*a)/(100*b))):
  for k in range(2+int((f-100*i*a-100*j*b)/c)):
   for l in range(2+int((f-100*i*a-100*j*b-k*c)/d)):
    S=100.0*a*i+100.0*b*j+c*k+d*l
    T=c*k+d*l
    if S!=0:
     L=100.0*T/S
     if S<=f and L<=100*e/(100+e) and L>noudo:
      noudo=L
      youeki=S
      yousitu=T
print(int(youeki),int(yousitu))


### FIXED CODE ###

N=int(input())
a=int(input())

print(N**2-a)
a=int(input())
print("ABC")if a<1200
print("ARC")if a<2800
print("AGC")if a>2799

### FIXED CODE ###

a=int(input())
if a<1200:
  print("ABC")
elif a<2800:
  print("ARC")
else:
  print("AGC")
H, W = map(int, input().split())

m = []
l = []
end = 0
for i in range(H):
    h = list(input())
    m.append(h)
    for j, w in enumerate(h):
        if w == '#':
            l.append([i, j])
            end += 1
HW = H * W
ans = 0
while (end < HW):
    nl = []
    for ll in l:
        if (0 < ll[0]):
            if (m[ll[1]][ll[0] - 1] == '.'):
                m[ll[1]][ll[0] - 1] = '#'
                end += 1
                nl.append([ll[1], ll[0] - 1])

        if (ll[0] < W - 1):
            if (m[ll[1]][ll[0] + 1] == '.'):
                m[ll[1]][ll[0] + 1] = '#'
                end += 1
                nl.append([ll[1], ll[0] + 1])

        if (0 < ll[1]):
            if (m[ll[1] - 1][ll[0]] == '.'):
                m[ll[1] - 1][ll[0]] = '#'
                end += 1
                nl.append([ll[1] - 1, ll[0]])

        if (ll[1] < H - 1):
            if (m[ll[1] + 1][ll[0]] == '.'):
                m[ll[1] + 1][ll[0]] = '#'
                end += 1
                nl.append([ll[1] + 1, ll[0]])
        l = nl
    ans += 1

print(ans)


### FIXED CODE ###



H, W = map(int, input().split())

m = []
l = []
end = 0
for y in range(H):
    h = list(input())
    m.append(h)
    for x, w in enumerate(h):
        if w == '#':
            l.append([y, x])
            end += 1
HW = H * W
ans = 0
# print(m[2][0]) m[y][x]
while (end < HW):
    nl = []
    for ll in l:
        if (0 < ll[1]):
            if (m[ll[0]][ll[1] - 1] == '.'):
                m[ll[0]][ll[1] - 1] = '#'
                end += 1
                nl.append([ll[0], ll[1] - 1])

        if (ll[1] < W - 1):
            if (m[ll[0]][ll[1] + 1] == '.'):
                m[ll[0]][ll[1] + 1] = '#'
                end += 1
                nl.append([ll[0], ll[1] + 1])

        if (0 < ll[0]):
            if (m[ll[0] - 1][ll[1]] == '.'):
                m[ll[0] - 1][ll[1]] = '#'
                end += 1
                nl.append([ll[0] - 1, ll[1]])

        if (ll[0] < H - 1):
            if (m[ll[0] + 1][ll[1]] == '.'):
                m[ll[0] + 1][ll[1]] = '#'
                end += 1
                nl.append([ll[0] + 1, ll[1]])

    l = nl
    ans += 1

print(ans)
s=list(input())
ans=0
pin=s[0]
for i in s[1:]:
  if s[i]==pin:
    ans+=1
    pin=s[i]
print(ans)

### FIXED CODE ###

s=list(input())
ans=0
pin=s[0]
for i in range(1,len(s)):
  if s[i]!=pin:
    ans+=1
    pin=s[i]
print(ans)
import numpy as np

def main():
    N, M = map(int, input().split())

    AB= np.array([list(map(int, list(input().split()))) for _ in range(N)])
    print(AB)
    
    AB_sort_by_A = np.sort(AB.view('i8,i8'), order=['f0'], axis=0).view(np.int)

    print(AB_sort_by_A)
    buyNum = 0
    money = 0
    for i in range(N):
        if buyNum >= M:
            break
        else:
            drinkVal, drinkNum = AB_sort_by_A[i]
            if M - buyNum > drinkNum:
                buyNum += drinkNum
                money += drinkVal * drinkNum
            else:
                money += drinkVal * (M-buyNum)
                break
    print(money)
        
            
    

    
    
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

H, W = map(int, input().split())
h, w = map(int, input().split())

res = (H-h)*(W-w)

print(res)
N,D = map(int,input().split())
a = (N-1)/(2*D)
if (N-1)%(2*D) == 0:
	print(a)
else:
 	print((N-1)//(2*D+1))


### FIXED CODE ###

r = int(input())
#rを定義してる
print("{}".format(3*r*r))
#出力したんや
# -*- coding: utf-8 -*-
n = int(input())
n = str(n)
if len(n) => 3:
    p = n[-3]+n[-2]+n[-1]
if len(n) == 2:
    p = n[-2]+n[-1]
if len(n) == 1:
    p = n[-1]
print(int(p))

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
a = 1000-n%1000
if a != 1000:
    print(a)
else:
    print(0)
N, x = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
sum = 0
ans = 0
for i in range(len(a) - 1):
    sum += a[i]
    if s > x:
        break
    else:
        ans += 1
sum += a[N-1]
if sum == x:
    ans += 1
print(ans)


### FIXED CODE ###

N, x = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
sum = 0
ans = 0
for i in range(len(a) - 1):
    sum += a[i]
    if sum > x:
        break
    else:
        ans += 1
sum += a[N-1]
if sum == x:
    ans += 1
print(ans)
from math import cos, radians, sqrt

A, B, H, M = map(int, input().split())
rad = radians(abs(360/(720/(60*H+M))-6*M))
ans = sqrt((A**2)+(B**2)-2*A*B*cos(rad))
print(ans)


### FIXED CODE ###

from math import cos, radians, sqrt

A, B, H, M = map(int, input().split())
rad = 0 if H==0 and M==0 else radians(abs(360/(720/(60*H+M))-6*M))
ans = sqrt((A**2)+(B**2)-2*A*B*cos(rad))
print(ans)
def tax(p,x):
    return p*(100+x)//100
def solve(X, Y, S):
    max_value=0
    for a in range(1,S):
        for b in range(1,S):
            sum_value=tax(a,X)+tax(b,X)
            if sum_value==S:
                c=tax(a,Y)+tax(b,Y)
                if c>max_value:
                    max_value=c
                if sum_value>S:　
                    break
    return max_value

while True:
    X,Y,Z=map(int, input().split())
    if X==0:
        break



### FIXED CODE ###

def tax(p,x):
    return p*(100+x)//100
def solve(X, Y, S):
    max_value=0 #max_valueをdef solveの前に入れるミスをしていて全く進みませんでした。関数の定義の理解が進みました。
    for a in range(1,S):
        for b in range(1,S):
            sum_value=tax(a,X)+tax(b,X)
            if sum_value==S:
                c=tax(a,Y)+tax(b,Y)
                if c>max_value:#最初は>=にしてたのですが、> にすることで高速化を図れました
                    max_value=c
                if sum_value>S: #bが増加すれば必ずSが増加することを使っていて、なるほどと思いました。
                    break
    return max_value

while True:
    X,Y,Z=map(int, input().split())
    if X==0:
        break
    print(solve(X,Y,Z))
#runtime errorになりましたが、ジャッジングデータと結果が一致しました。制限時間内に解く方法がわかりませんでした。
#右・中央の座席
w = int(raw_input())
n = int(raw_input())
l = [i for i in range(1,w+1)]
while n > 0:
  a,b = map(int,raw_input().split(','))
  l[a-1],l[b-1] = l[b-1],l[a-1]
  n -= 1
for i in l:
  print(i)

### FIXED CODE ###

w = int(input())
n = int(input())
l = [i for i in range(1,w+1)]
while n > 0:
  a,b = map(int,input().split(','))
  l[a-1],l[b-1] = l[b-1],l[a-1]
  n -= 1
for i in l:
  print(i)
import sys
import copy
from queue import Queue
sys.setrecursionlimit(1000000000)

def dfs(start, paths, count):
    if count <= 1:
        return 1
    
    indixies = findNodeIndex(start, paths)
    if len(indixies) == 0:
        return 0
    count = 0
    for i in indixies:
        nextNode = paths[i][1] if paths[i][0] == start else  paths[i][0]
        newPaths = copy.deepcopy(paths)
        newPaths.pop(i)
        count += dfs(nextNode, newPaths, count - 1)
    return count

def findNodeIndex(node, paths):
    return [i for (i, row) in filter(lambda x: x[1][0] == node or x[1][1] == node, [(i, row) for i, row in enumerate(paths)])]

N, M = map(int, input().split())
PATHS = [list(map(int, input().split())) for _ in range(N)]
#start = findNodeIndex(1, PATHS)

print(dfs(1, PATHS, M))

### FIXED CODE ###

import sys
import copy
sys.setrecursionlimit(1000000000)

def dfs(start, total, usedNodes):
    if start in usedNodes:
        return 0
    
    if total <= 1:
        return 1
    
    indices = findNodeIndex(start)
    if len(indices) == 0:
        return 0

    count = 0
    for i in indices:
        nextNode = PATHS[i][1] if PATHS[i][0] == start else PATHS[i][0]
        count += dfs(nextNode, total - 1, usedNodes + [start])
    return count

def findNodeIndex(node):
    return [i for (i, row) in filter(lambda x: (x[1][0] == node or x[1][1] == node), [(i, row) for i, row in enumerate(PATHS)])]

N, M = map(int, input().split())
PATHS = [list(map(int, input().split())) for _ in range(M)]
#start = findNodeIndex(1, PATHS)

print(dfs(1, N, []))
n = int(input())
flag = 0
for i in range(len(n)-1):
  if n[i] == n[i+1]:
    flag = 1

if flag == 1:
  print("Bad")
else:
  print("Good)

### FIXED CODE ###

n = input()
flag = 0
for i in range(len(n)-1):
    if n[i] == n[i+1]:
        flag = 1

if flag == 1:
    print("Bad")
else:
    print("Good")
N=int(input())
X=sorted(list(map(int,input().split())))

ans = 100000000

for p in range(X[0], X[N]): #Pの位置
  sum = 0
  for x in X: #Xの要素を１つずつ取得
    sum += (x - p)**2
  ans = min(sum, ans)

print(ans)
    


### FIXED CODE ###

N=int(input())
X=list(map(int,input().split()))
ans = 100000000
for j in range(1,100):
  res = 0
  for i in range(N):
    res += (X[i]-j)**2
  ans=min(ans,res)
print(ans)
NL=input().split()
N=int(NL[0])
L=int(NL[1])

S=[]
rank=[]
for i in range(N):
    S.append(input())
    rank.append(0)
temp=[]
for i in range(N):
    for j in range(N):
        if(S[i]<S[j]):
           temp.append(int(1))
        else:
            temp.append(int(0))        

for i in range(N*N):
    a=i%N
    rank[a]+=temp[i]
j=0
moji=""
for i in range(N):
    for j in range(N):
        if(i==rank[j]):
            moji=moji+S[j]
print(moji)
        


### FIXED CODE ###

N=input()
N=N.split()
sum=0
flag1=0
flag2=0
for i in N:
    if(i=="5"):
        flag1=1
    if(i=="7"):
        flag2=1
    sum=sum+int(i)
if(sum == 17 and flag1 == 1 and flag2 == 1):
    print("YES")
else:
    print("NO")
from math import log2,ceil
import sys
input=sys.stdin.readline
n=int(input())
a=tuple(map(int,input().split()))
mod=10**9+7
cnt=[0]*60

for temp in a:
    if temp==0:continue
    digit=len(bin(temp))-2
    for j in range(ceil(digit)+1):
        if (temp>>j)&1:
            cnt[j]=cnt[j]+1

#print(cnt)
ans=0
for i in range(60):
    if cnt[i]==0:continue
    ans=(ans+pow(2,i)*cnt[i]*(n-cnt[i]))%mod
print(ans%mod)


### FIXED CODE ###

import sys
input=sys.stdin.readline
n=int(input())
a=tuple(map(int,input().split()))
mod=10**9+7
cnt=[0]*60

for temp in a:
    if temp==0:continue
    digit=len(bin(temp))-2
    for j in range(digit):
        if (temp>>j)&1:
            cnt[j]=cnt[j]+1

#print(cnt)
ans=0
for i in range(60):
    if cnt[i]==0:continue
    ans=(ans+pow(2,i)*cnt[i]*(n-cnt[i]))%mod
print(ans%mod)
num = int(input())

count_max = 0
for i in range(num):
  tmp = i + 1
  count = 0
  while tmp % 2 == 0:
    tmp = tmp / 2
    count += 1
  if count > count_max:
    count_max = count
    num_max = i + 1

print(num_max)

### FIXED CODE ###

num = int(input())

count_max = 0
num_max = 0
for i in range(1, num+1):
  tmp = i
  count = 0
  while tmp % 2 == 0:
    tmp = tmp / 2
    count += 1
  if count >= count_max:
    count_max = count
    num_max = i

if num == 1:
  print(1)
else:
  print(num_max)
a=int(input("enter a no"))
b=int(input("enter a no"))

if a>2*b:
	print(a-2*b)


else:
	print(0)


### FIXED CODE ###

a, b = [int(x) for x in input().split()]
ans = a - 2*b

if(ans < 0):
		ans=0

print(ans)
N = int(input())
A = list(map(int,input().split()))
cnt = 1

for i in range(N):
    cnt *= A[i]
    if(cnt > 1e18):
	print(-1)
	sys.exit()

if(cnt <= 1e18):
    print(cnt)
else:
    print(-1)




### FIXED CODE ###

import sys

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

for i in range(N):
    if(A[i] == 0):
        print(0)
        sys.exit()

for i in range(N):
    cnt *= A[i]
    if(cnt > 1e18):
        print(-1)
        sys.exit()

if(cnt <= 1e18):
    print(cnt)
else:
    print(-1)
H, W = map(int, input().split())
pos = [[0, 0]]
S = [input() for i in range(H)]
p = 1
def whiteout(Map, h, w):
  y = 0
  for i in range(h):
    for j in range(w):
      if Map[i][j] == '#':
        y += 1
  return y == 0

while pos != [H-1, W-1]:
  cnt = 0
  x, y = pos[0], pos[1]
  S[x] = S[x][:y] + '.' + S[x][y+1:]
  if x < H-1:
    if S[x+1][y] == '#':
      cnt += 1
      pos = [x+1, y]
  if y < W-1:
    if S[x][y+1] == '#':
      cnt += 1
      pos = [x, y+1]
  if cnt != 1:
    p = 0
    break
S[H-1] = S[H-1][:W-1] + '.'
if p == 1 and whiteout(S, H, W):
  print("Possible")
else:
  print("Impossible")


### FIXED CODE ###

H, W = map(int, input().split())
pos = [0, 0]
S = [input() for i in range(H)]
p = 1
def whiteout(Map, h, w):
  y = 0
  for i in range(h):
    for j in range(w):
      if Map[i][j] == '#':
        y += 1
  return y == 0

while pos != [H-1, W-1]:
  cnt = 0
  x, y = pos[0], pos[1]
  S[x] = S[x][:y] + '.' + S[x][y+1:]
  if x < H-1:
    if S[x+1][y] == '#':
      cnt += 1
      pos = [x+1, y]
  if y < W-1:
    if S[x][y+1] == '#':
      cnt += 1
      pos = [x, y+1]
  if cnt != 1:
    p = 0
    break
S[H-1] = S[H-1][:W-1] + '.'
if p == 1 and whiteout(S, H, W):
  print("Possible")
else:
  print("Impossible")
p=10**9+7
X, Y=map(int, input().split())

if (X+Y)%3>0:
  print(0)
  exit()
  
a=(2*X-Y)//3
b=(2*Y-X)//3

ab=a+b
ue=[1]*(ab+1)
for i in range(1, ab+1):
  ue[i]=ue[i-1]*i%p
  
out=ue[-1]*pow(ue[a], p-2, p)%p
out=out*pow(ue[b], p-2, p)%p

print(out)

### FIXED CODE ###

p=10**9+7
X, Y=map(int, input().split())

if (X+Y)%3>0:
  print(0)
  exit()
  
a=(2*X-Y)//3
b=(2*Y-X)//3

if a*b<0:
  print(0)
  exit()

ab=a+b
ue=[1]*(ab+1)
for i in range(1, ab+1):
  ue[i]=ue[i-1]*i%p
  
out=ue[-1]*pow(ue[a], p-2, p)%p
out=out*pow(ue[b], p-2, p)%p

print(out)
n = int(input())
class Node(object):
    def __init__(self, p, l, r):
        self.p = p
        self.l = l
        self.r = r

nodes = [Node(None, None, None) for i in range(n)]

for i in range(n):
    id, left, right = map(int, input().split())
    nodes[i].l = left
    nodes[i].r = right
    if left != -1:
        nodes[left].p = i
    if right != -1:
        nodes[right].p = i

def pre(node):
    print(node, end=" ")
    if nodes[node].l != -1:
        pre(nodes[node].l)
    if nodes[node].r != -1:
        pre(nodes[node].r)

def ino(node):
    if nodes[node].l != -1:
        ino(nodes[node].l)
    print(node, end=" ")
    if nodes[node].r != -1:
        ino(nodes[node].r)

def post(node):
    if nodes[node].l != -1:
        post(nodes[node].l)
    if nodes[node].r != -1:
        post(nodes[node].r)
    print(node, end=" ")

for ind, n in enumerate(nodes):
    if n.p != -1:
        root = ind
        break

print('Preorder')
pre(root)
print('\n')
print('InOrder')
ino(root)
print('\n')
print('Postorder')
post(root)

### FIXED CODE ###

n = int(input())
class Node(object):
    def __init__(self, p, l, r):
        self.p = p
        self.l = l
        self.r = r

nodes = [Node(None, None, None) for i in range(n)]

for i in range(n):
    id, left, right = map(int, input().split())
    nodes[id].l = left
    nodes[id].r = right
    if left != -1:
        nodes[left].p = i
    if right != -1:
        nodes[right].p = i

def pre(node,path):
    path.append(node)
    if nodes[node].l != -1:
        pre(nodes[node].l,path)
    if nodes[node].r != -1:
        pre(nodes[node].r,path)

def ino(node,path):
    if nodes[node].l != -1:
        ino(nodes[node].l,path)
    path.append(node)
    if nodes[node].r != -1:
        ino(nodes[node].r,path)

def post(node,path):
    if nodes[node].l != -1:
        post(nodes[node].l,path)
    if nodes[node].r != -1:
        post(nodes[node].r,path)
    path.append(node)

for ind, n in enumerate(nodes):
    if n.p == None:
        root = ind
        break
print('Preorder')
l = []
pre(root, l)
print(' ' +  ' '.join(map(str, l)))
print('Inorder')
l = []
ino(root, l)
print(' ' +  ' '.join(map(str, l)))
print('Postorder')
l = []
post(root,l)
print(' ' + ' '.join(map(str, l)))
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
c=0
for i in range(len(a)+1):
  if x>0:
    x-=a[i]
    c+=1
  else:
    print(c)


### FIXED CODE ###

n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
c=0
for i in range(n):
  if n>=i and x>=a[i]:
    x-=a[i]
    c+=1
    if n==c and x==0:
      print(n)
    if n==c and x!=0:
      print(n-1)
  else:
    print(c)
    break
a, b, c = map(int, input().split())
k = int(input())
s = a+b+c

for i in range(k):
    s += max(a+b+c)

print(s)


### FIXED CODE ###

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

for i in range(k):
    s += max(a,b,c)
    if max(a,b,c) == a:
        a*=2
    elif max(a,b,c) == b:
        b*=2
    else:
        c*=2        
print(s)
X= int(input())

for b in range(-100, 100):
    for a in range(100):
        if a**5 == X + b**5:
            ans =(a, b)
            break
print(*ans)

### FIXED CODE ###

X= int(input())

for b in range(-200, 200):
    for a in range(200):
        if a**5 == X + b**5:
            ans =(a, b)
            break
print(*ans)
s = input()
if s == "Sunny"
print("Cloudy")
elif s == "Cloudy"
print("Rainy")
elif s == "Rainy"
print("Sunny")

### FIXED CODE ###

s = input()
if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif s == "Rainy":
    print("Sunny")
N = int(input())
X = input()
S = []
for a in range(N):
    S.append(X[a])
if N == 1:
    print(S)
else:
    
    for i in range(N-1):
        if S[i] == 'X':
            continue
        elif S[i] != S[i+1]:
            continue
        else:
            j = i+1
            while S[i] == S[j]:
                j += 1
            for l in range(i+1,j):
                S[l] = 'X'
print(S)

lista = [k for k in S if k != 'X']
print(''.join(lista))

### FIXED CODE ###

N = int(input())
X = input()
S = []
for a in range(N):
    S.append(X[a])

if N == 1:
    print(1)
else:
    for i in range(1,N):
        if S[i] != S[i-1]:
            continue
        else:
            S[i-1] = 'X'
    lista = [k for k in S if k != 'X']
    print(len(lista))
N = iot(input())
print(N//3)

### FIXED CODE ###

N = int(input())
print(N//3)
import heapq

n, k = map(int, input().split())
sushi = [list(map(int, input().split())) for _ in range(n)]
sushi.sort(key=lambda x: x[1])
t = {}
x = []
z = 0
for i in range(n - 1, n - k - 1, -1):
    ti, di = sushi[i]
    if ti in t.keys():
        heapq.heappush(x, di)
        t[ti] += 1
    else:
        t[ti] = 1
    z += di

ans = z + len(t.keys()) ** 2
for i in range(n - k - 1, -1, -1):
    ti, di = sushi[i]
    if ti not in t.keys():
        t[ti] = 1
        z += di - heapq.heappop(x)
        ans = max(ans, z + len(t.keys()) ** 2)
        k += 1

print(ans)


### FIXED CODE ###

import heapq

n, k = map(int, input().split())
sushi = [list(map(int, input().split())) for _ in range(n)]
sushi.sort(key=lambda x: x[1])
t = {}
x = []
z = 0
for i in range(n - 1, n - k - 1, -1):
    ti, di = sushi[i]
    if ti in t.keys():
        heapq.heappush(x, di)
        t[ti] += 1
    else:
        t[ti] = 1
    z += di

p = len(t.keys())
ans = z + p ** 2
for i in range(n - k - 1, -1, -1):
    if len(x) == 0:
        break
    ti, di = sushi[i]
    if ti not in t.keys():
        t[ti] = 1
        z += di - heapq.heappop(x)
        p += 1
        ans = max(ans, z + p ** 2)

print(ans)
a = [list(map(int, input().split())) for i in range(3)]
output =[[0,0,0],[0,0,0],[0,0,0]]
n = int(input())
check=False
for k in range(n):
    b=int(input())
    for i in range(3):
        for j in range(3):
            if a[i][j]==b:
                output[i][j]=1
for i in range(3):
    if output[i][0]*output[i][1]*output[i][2]==1:
        check=True
    elif output[0][i]*output[1][i]*output[2][i]==1:
        check=True
if output[0][0]*output[1][1]*output[2][2]==1:
    check=True
elif output[2][0]*output[1][1]*output[0][2]==1:
    check=True
if check==True:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a=int(input())
if a%2==0:
  print(int(a/2))
else:
  print(int(a/2)+1)
n = int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(len(a_list)):
    ans_list.append(a_list[i] - i - 1)
import numpy as np
if len(ans_list)% 2 == 0:
    cary1 = np.delete(ans_list, max(ans_list))
    cary2 = np.delete(ans_list, min(ans_list))
    number1 = int(np.median(cary1))
    number2 = int(np.median(cary2))
    ans1 = 0
    for i in ans_list:
        ans1 += abs(i - number1)
    ans2 = 0
    for i in ans_list:
        ans2 += abs(i - number2)
    print(min(ans1 , ans2))
    
else:
    cary = ans_list
    number = int(np.median(cary))
    ans = 0
    for i in ans_list:
        ans += abs(i - number)
    print(ans)

### FIXED CODE ###

n = int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(len(a_list)):
    ans_list.append(a_list[i] - i - 1)
import numpy as np
if len(ans_list)% 2 == 0:
    ans_list1 = sorted(ans_list)
    number1 = ans_list1[n//2]
    number2 = ans_list1[n//2 + 1]
    
    ans1 = 0
    ans2 = 0
    for i in ans_list:
        ans1 += abs(i - number1)
        ans2 += abs(i - number2)
    print(min(ans1 , ans2))
else:
    cary = ans_list
    number = int(np.median(cary))
    ans = 0
    for i in ans_list:
        ans += abs(i - number)
    print(ans)
r,g,b= map(int(input().split()))
num = 100*r + 10*g + b
if num %4 == 0:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

a = list(map(int,input().split()))
num = 100*a[0]+ 10*a[1] + a[2]
if num %4 == 0:
    print('YES')
else:
    print('NO')
a,b,c=[int(x) for x in input().split()]
x = b
count = 0
while True:
    if x == a: break
    elif x%c == 0 : count +=,x -=
print(count)


### FIXED CODE ###

a,b,c=[int(x) for x in input().split()]
count = 0
for d in range(a,b+1):
    if c%d == 0 : count += 1
print(count)
fac = []


def init():
    fac.append(1)
    for i in range(1, 2003):
        fac.append(fac[i - 1] * i)


def c(a, b):
    return fac[a] // fac[b] // fac[a - b]


init()
data = input().split(" ")
n = int(data[0])
b = int(data[1])
r = n - b
for i in range(1, b+1):
    print(int(c(b-1, i-1) * c(r+1, i) % (1e9 + 7)))


### FIXED CODE ###

fac = []


def init():
    fac.append(1)
    for i in range(1, 2003):
        fac.append(fac[i - 1] * i)


def c(a, b):
    return fac[a] // fac[b] // fac[a - b]


init()
data = input().split(" ")
n = int(data[0])
b = int(data[1])
r = n - b
for i in range(1, b+1):
    print(int(c(b-1, i-1) * c(r+1, i) % int(1e9 + 7)))
import operator as op
from functools import reduce
def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return int(numer / denom)
NK = list(map(int, input().split()))
N = NK[0]
K = NK[1]
sumOfAll = 0
oneToNSum = int((N)*(N+1)/2 - 1)
for k in range(K,N+1):
    NCKm1 = ncr(N, K - 1)
    sumOfAll += N * NCKm1 * 10 ^ 100 + NCKm1 * oneToNSum
print(sumOfAll%(7+10^9))

### FIXED CODE ###

NK = list(map(int, input().split()))
N = NK[0]
K = NK[1]
sumOfAll = 0
for howManyWeChoose in range(K, N+2):
    until = int(N*(N+1)/2 - (N-howManyWeChoose)*(N-howManyWeChoose+1)/2)
    start = int(howManyWeChoose*(howManyWeChoose-1)/2)
    sumOfAll += until-start+1
print(sumOfAll%(7+10**9))
sum=0
for i in range(5):
  y=int(input())
  x=y%10
  if x==0:
    sum+=y
  else:
    min=min(x, 9)

### FIXED CODE ###

X=[int(input()) for i in range(5)]
Y=[]
for x in X:
  Y.append(-(-x//10)*10-x)
print(sum(X)+sum(Y)-(max(Y)))