Harryxun/stf_run huggingface dataset:
def xor_plus(l1,l2):#引数はリストであることに注意
    l = [0] * max(len(l1),len(l2))
    for i in range(1,len(l)):
        if i > len(l1):
            l[-i] = l2[-i]
        elif i > len(l2):
            l[-i] = l1[-i]
        elif l1[-i] == l2[-i]:
            l[-i] = 0
        else:
            l[-i] = 1
    return l#返り値はリストであることに注意


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

a_bin = [0] * n

for i in range(0,n):
    a_bin[i] = list(map(int,list(bin(a[i]))[2:]))
    
print("a_bin")
print(a_bin)

k_bin = list(map(int, list(bin(k+1))[2:]))
print("k_bin")
print(k_bin)


print("x_bin")
print(x_bin)

m = [0] * len(k_bin)

for i in range(0,len(k_bin)):
    x_bin = [0] * (len(k_bin))
    if k_bin[i] == 0:
        continue
    for j in range(0,i):
        x_bin[j] = k_bin[j]
    
    print(x_bin)
    
    
    for j in range(1,len(k_bin)-i):
        count = 0
        for l in range(0,n):
            if j <= len(a_bin[l]):
                count += a_bin[l][-j]
        print([-j,count])
        if count <= n - count:
            x_bin[-j] = 1
    
    val = 0
    print(x_bin)
    
    for j in range(0,n):
        lis = list(map(str, xor_plus(x_bin,a_bin[j])))
        print(lis)
        val = val + int(''.join(lis),2)
        print(val)
    m[i] = val

print(max(m))

### FIXED CODE ###

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

def f(x):
    ret = 0
    for i in range(N):
        ret += A[i] ^ x
    return ret

###2**(num-1)<=K<2**numなるnumを求める
P = bin(K)
num = len(list(map(int,P[2:])))

best = 0

for i in range(num):
    count = 0###2**iの位が1になるAの個数
    for j in range(N):
        if A[j] > A[j]^(2**i):
            count += 1
    
    if count <= N - count:
        best += 2**i

#print(best)
can = [0]*40

for i in range(40):
    if K & 2**i == 0:
        continue
    for j in range(0,i):
        can[i] += best & 2**j
    for j in range(i+1,40):
        can[i] += K & 2**j

can.append(K)

print(max(list(map(f,can))))
import math
a, b = map(int, input().split())
A = math.floor(a/0.08)
B = math.floor((a/0.8)/0.1)


c = math.gcd(A, B)
if c == 1 or c >= 100:
    print(-1)
else:
    print(c)

### FIXED CODE ###


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

c =0 
for n in range(0,10000):
    taxa = int(n*8/100)
    taxb = int(n*10/100)
    if a == taxa and b == taxb:
        print(n)
        break
    else:
        c += 1
if c > 9999:
    print(-1)
a,b,c = map(int, input().split())

if a<c<b or b<c<a:
  print('Yes)
else:
  print('No)


### FIXED CODE ###

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

if a<c<b or b<c<a:
  print('Yes')
else:
  print('No')
l=[int(x) for x in list(input())]
if l[0]+l[1]+l[2]+l[3]==7: print('{}+{}+{}+{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]+l[1]+l[2]-l[3]==7: print('{}+{}+{}-{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]+l[1]-l[2]+l[3]==7: print('{}+{}-{}+{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]+l[1]-l[2]-l[3]==7: print('{}+{}-{}-{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]-l[1]+l[2]+l[3]==7: print('{}-{}+{}+{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]-l[1]+l[2]-l[3]==7: print('{}-{}+{}-{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]-l[1]-l[2]+l[3]==7: print('{}-{}-{}+{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]-l[1]-l[2]-l[3]==7: print('{}-{}-{}-{}=7'.format(l[0],l[1],l[2],l[3])


### FIXED CODE ###

l=[int(x) for x in list(input())]
if l[0]+l[1]+l[2]+l[3]==7: print('{}+{}+{}+{}=7'.format(l[0],l[1],l[2],l[3]))
elif l[0]+l[1]+l[2]-l[3]==7: print('{}+{}+{}-{}=7'.format(l[0],l[1],l[2],l[3]))
elif l[0]+l[1]-l[2]+l[3]==7: print('{}+{}-{}+{}=7'.format(l[0],l[1],l[2],l[3]))
elif l[0]+l[1]-l[2]-l[3]==7: print('{}+{}-{}-{}=7'.format(l[0],l[1],l[2],l[3]))
elif l[0]-l[1]+l[2]+l[3]==7: print('{}-{}+{}+{}=7'.format(l[0],l[1],l[2],l[3]))
elif l[0]-l[1]+l[2]-l[3]==7: print('{}-{}+{}-{}=7'.format(l[0],l[1],l[2],l[3]))
elif l[0]-l[1]-l[2]+l[3]==7: print('{}-{}-{}+{}=7'.format(l[0],l[1],l[2],l[3]))
elif l[0]-l[1]-l[2]-l[3]==7: print('{}-{}-{}-{}=7'.format(l[0],l[1],l[2],l[3]))
n = int(input())
a = list(map(int , input().split()))
sa = set()
for ai in a:
    if ai in sa:
        sa.discard(ai)
        continue
    sa.add(ai)

if len(sa) == 0:
    print(0)
    exit()

a = list(sa)
a.sort()

#print(a)

import fractions
def lcm(a, b):
    return a * b // fractions.gcd(a, b)

ans = 1
l = 1
for i in range(n):
    if lcm(a[i], l) < a[i] * l:
        continue
    l = lcm(a[i], l)
    ans += 1
print(ans, l)




### FIXED CODE ###

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

a.sort()

#print(a)
import numpy as np
U=10**6 + 5
is_prime = np.zeros(U,np.bool)
#is_prime[2] = 1
is_prime[1::] = 1
M = int(U**.5)+1
for ai in a:#range(3,M,2):
    if is_prime[ai]:
        is_prime[ai*2::ai] = 0
    #print(is_prime.nonzero()[0])

ans = 0

import collections
cnt = collections.Counter(a)
for ai in a:
    if is_prime[ai] and cnt[ai] == 1:
        ans += 1

print(ans)

"""
sa = set()
for ai in a:
    if ai in sa:
        sa.discard(ai)
        continue
    sa.add(ai)
"""

"""
p = list(range(10**6+10))

a = list(sa)
a.sort()

print(a)

import fractions
def lcm(a, b):
    return a * b // fractions.gcd(a, b)

ans = 1
l = 1
for i in range(n):
    if lcm(a[i], l) < a[i] * l:
        continue
    l = lcm(a[i], l)
    ans += 1
print(ans)

"""
import sys
readline=sys.stdin.readline

N,X,M = map(int,readline().split())
route = [X]
dic = {}
first = []
loop = []
for i in range(1, N):
  X = (X ** 2) % M
  if X in dic:
    first = route[:dic[X]]
    loop = route[dic[X]:]
    break
  route.append(X)
  dic[X] = i

if N == len(first):
  print(sum(first))
elif N < len(first):
  print(sum(first[:N]))
else:
  ans = sum(first)
  one_loop = sum(loop)
  N -= len(first)
  loop_cnt = N // len(loop)
  rest = N % len(loop)
  ans += loop_cnt * (sum(loop))
  ans += sum(loop[:rest])

  print(ans)


### FIXED CODE ###

import sys
readline=sys.stdin.readline

N,X,M = map(int,readline().split())
route = [X]
dic = {}
first = []
loop = []
for i in range(1, N):
  X = (X ** 2) % M
  if X in dic:
    first = route[:dic[X]]
    loop = route[dic[X]:]
    break
  route.append(X)
  dic[X] = i
  
if len(first) == 0:
  print(sum(route[:N]))
  exit(0)

if N == len(first):
  print(sum(first))
elif N < len(first):
  print(sum(first[:N]))
else:
  ans = sum(first)
  one_loop = sum(loop)
  N -= len(first)
  loop_cnt = N // len(loop)
  rest = N % len(loop)
  ans += loop_cnt * (sum(loop))
  ans += sum(loop[:rest])

  print(ans)
import sympy as sym
def FibRe(n):
    x = sym.symbols('x',nonnegative=True,integer=True)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1))
    result=Fib.subs(x,n)
    result=result.evalf(int(n*3/14)+1)
    return int(result)

N,M = map(int,input().split())
if M == 0:
  print(FibRe(N+2))
else:
  S = []
  for _ in range(M):
    S.append(int(input()))
  S.append(-1)
  S.append(N+1)
  S.sort()  
  P = 1

  for i in range(M+1):
    P *= FibRe(S[i+1]-S[i]) 

  print(P%1000000007)

### FIXED CODE ###

def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

N,M = map(int,input().split())
if M == 0:
  P = Fib(N+2)
  print(P%1000000007)
else:
  S = []
  for _ in range(M):
    S.append(int(input()))
  S.append(-1)
  S.append(N+1)
  S.sort()  
  P = 1

  for i in range(M+1):
    P *= Fib(S[i+1]-S[i]) 

  print(P%1000000007)
H,W,k=rm()
a=[list(input()) for i in range(H)]
ans=0
for h in range(1<<H):
    for w in range(1<<W):
        count=0
        for i in range(H):
            for j in range(W):
                if (a[i][j]!='#'):
                    continue
                if h>>i&1!=0 or w>>j&1!=0:
                    continue
                count+=1
        if count==k:
            ans+=1
print(ans)

### FIXED CODE ###

import sys
import math
import heapq
from collections import defaultdict, deque
from decimal import *
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))
mod=1000000007

H,W,k=rm()
a=[list(input()) for i in range(H)]
ans=0
for h in range(1<<H):
    for w in range(1<<W):
        count=0
        for i in range(H):
            for j in range(W):
                if (a[i][j]!='#'):
                    continue
                if h>>i&1!=0 or w>>j&1!=0:
                    continue
                count+=1
        if count==k:
            ans+=1
print(ans)
n = int(input())
T = list(map(int, input().split()))
sumT = sum(T)
m = int(input())
D = list(map(int, input().split()))
for i, d in enumerate(D):
  print(sumT - T[i] + d)

### FIXED CODE ###

n = int(input())
T = list(map(int, input().split()))
sumT = sum(T)
m = int(input())
for i in range(m):
  a, b = map(int, input().split())
  print(sumT - T[a - 1] + b)
N, L =  list(map(int, input().split()))
r = np.arange(L, N + L)
print(np.sum(r) - r[np.argmin(np.abs(r))])

### FIXED CODE ###

import numpy as np
N, L =  list(map(int, input().split()))
r = np.arange(L, N + L)
print(np.sum(r) - r[np.argmin(np.abs(r))])
# 高橋君は500円玉をK枚持っています。 これらの総額がX円以上である場合は Yes を、そうでない場合は No を出力してください。
# コマンドライン引数 K X
# 制約　1≤K≤100　1≤X≤10^5

import sys

# コマンドライン引数を変数に入れる
if 1 < len(sys.argv) < 4:
    K = sys.argv[1]
    X = sys.argv[2]

# コマンドライン引数が想定外
else:
    print("引数の指定に誤りがあります")

# 総額の保持
sum = 500 * int(K)

# 出力文の作成
if sum >= int(X):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

# 高橋君は500円玉をK枚持っています。 これらの総額がX円以上である場合は Yes を、そうでない場合は No を出力してください。
# コマンドライン引数 K X
# 制約　1≤K≤100　1≤X≤10^5

import sys

inp_word = input()

# コマンドライン引数を変数に入れる
K,X = inp_word.split()

# 総額の保持
sum = 500 * int(K)

# 出力文の作成
if sum >= int(X):
    print('Yes')
else:
    print('No')
import math

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

g_l = [1 for i in range(N)]
g_r = [1 for i in range(N)]

g_l[0] = A[0]
g_r[-1] = A[-1]

for i in range(1, N):
    g_l[i] = math.gcd(A[i], g_l[i-1])
    g_r[-i-1] = math.gcd(A[-i-1], g_r[-i])

ans = max(g_r[1], g_l[-2])
for i in range(1, N-1):
    ans = max(ans, math.gcd(A[i-1], A[i+1]))

print(ans)


### FIXED CODE ###

def gcd(a, b):
    tmp = a%b
    if tmp == 0:
        return b
    return gcd(b, tmp)

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

g_l = [1 for i in range(N)]
g_r = [1 for i in range(N)]

g_l[0] = A[0]
g_r[-1] = A[-1]

for i in range(1, N):
    g_l[i] = gcd(A[i], g_l[i-1])
    g_r[-i-1] = gcd(A[-i-1], g_r[-i])

ans = max(g_r[1], g_l[-2])
for i in range(1, N-1):
    ans = max(ans, gcd(g_l[i-1], g_r[i+1]))

print(ans)
while 1:
  a,op,b = map(int,raw_input().split())
  if op == "+":
    print "%d" %(a + b)
  elif op == "-":
    print "%d" %(a - b)
  elif op == "*":
    print "%d" %(a * b)
  elif op == "/":
    print "%d" %(a / b)
  else:
    break
  

### FIXED CODE ###

while 1:
  s = raw_input().split()
  a, b =int(s[0]), int(s[2])
  op = s[1] 

  if op == "+":
    print "%d" %(a + b)
  elif op == "-":
    print "%d" %(a - b)
  elif op == "*":
    print "%d" %(a * b)
  elif op == "/":
    print "%d" %(a / b)
  else:
    break
# -*- using:utf-8 -*-
import itertools

if __name__ == "__main__":
  n = int(input())
  li = list(map(int, input().split()))
  array = list(itertools.combinations(li, 2))
  sum = 0
  for i in range(n):
    sum += array[i][0] * array[i][1]
  print(sum)

### FIXED CODE ###

# -*- using:utf-8 -*-

class main:
  def function(n, a):
    mod = 10 **9 +7
    S = [0] * (n + 1)
    for i in range(n):
      S[i + 1] = S[i] + a[i]
    SN = S[-1]
    ans = 0
    for i in range(n - 1):
      cnt = a[i] * (SN - S[i + 1])
      ans += cnt
    print(ans % mod)



if __name__ == "__main__":
  n = int(input())
  a = list(map(int, input().split()))
  main.function(n,a)
from collections import deque
from itertools import chain

def bfs(maze,visited,gy,gx):
    que = deque([[1,1]])
    visited[1][1] = 0
    
    while que:
        y,x = que.popleft()
        if [y,x] == [gy,gx]:
            return visited[y][x]
        for j,k in ([1,0],[-1,0],[0,1],[0,-1]):
            ny,nx = y+j,x+k
            if maze[ny][nx] == "." and visited[ny][nx] == -1:
                visited[ny][nx] = visited[y][x] + 1
                que.append([ny,nx])

h,w = map(int,input().split())
maze = ["#"*(w+2)] + ["#"+input()+"#" for _ in range(h)] + ["#"*(w+2)]
visited = [[-1]*(w+2) for _ in range(h+2)]
sr = bfs(maze,visited,h,w)

num_dot = list(chain.from_iterable(maze))
num_dot = num_dot.count('.')
num_sharp = h*w - num_dot
print(h*w - num_sharp - sr - 1)

### FIXED CODE ###

from collections import deque

def bfs(maze,visited,sy,sx,gy,gx):
    Step = ([1,0],[0,1],[-1,0],[0,-1])
    
    que = deque([[sx,sy]])
    visited[sx][sy] = 1
    
    while que:
        y,x = que.popleft()
        if [y,x] == [gy,gx]:
            return visited[y][x]
        for j,k in Step:
            ny,nx = y+j , x+k
            if 0 <= ny <= gy and 0 <= nx <= gx:
                if maze[ny][nx] == '.' and visited[ny][nx] == INF:
                    visited[ny][nx] = visited[y][x] + 1
                    que.append([ny,nx])


h,w = map(int,input().split())
maze = [input().strip() for _ in range(h)]

cntSharp = 0
for i in range(h):
    cntSharp += maze[i].count('.')

INF = 10**5
visited = [[INF]*w for _ in range(h)]

sx,sy = 0,0
gy,gx = h-1,w-1

minStep = bfs(maze,visited,sy,sx,gy,gx)
print(cntSharp - minStep if visited[gy][gx] != INF else -1)
ri = lambda: map(int, input().split())

N, M = ri()
H = list(ri())
G = [[0]*N for _ in range(N)]
for _ in range(M):
    a, b = ri()
    G[a-1][b-1] = H[b-1]
    G[b-1][a-1] = H[a-1]

T = [max(r) for r in G]
print(sum(1 for i, h in enumerate(T) if h == 0 or h < H[i]))


### FIXED CODE ###

ri = lambda: map(int, input().split())

N, M = ri()
H = list(ri())
T = [0]*N
for _ in range(M):
    a, b = ri()
    T[a-1] = max(T[a-1], H[b-1])
    T[b-1] = max(T[b-1], H[a-1])

print(sum(1 for i, h in enumerate(T) if h == 0 or h < H[i]))
r1,c1,r2,c2 = map(int,input().split())
n = [[1]*(c2+1) for i in range(r2+1)]
mod = 10**9 + 7
ans = 0
for r in range(r2):
    for c in range(c2):
        n[r+1][c+1] = (n[r][c+1] + n[r+1][c])%mod
        if r >= r1-1 and c >= c1-1:
            ans += n[r+1][c+1]
            ans %= mod
            
print(ans)

### FIXED CODE ###

r1,c1,r2,c2 = map(int,input().split())

n = [1]*(r2+c2+3)
mod = 10**9 + 7
for i in range(r2+c2+2):
    n[i+1] = (n[i]*((i+1)%mod))%mod

def calc(r,c):
    x = n[r+c]%mod
    y = (n[r]*n[c])%mod
    return (x*(pow(y,mod-2,mod)%mod))%mod

ans = calc(r2+1,c2+1)-calc(r2+1,c1)-calc(r1,c2+1)+calc(r1,c1)
ans %= mod

print(ans)
a = int(input())
b = int(input())
c = str(a)*b
d = str(b)*a
if(c < d):
  print (c)
else:
  print(d)

### FIXED CODE ###

(a , b) = list (map (int, input().strip().split()))
c = str(a)*b
d = str(b)*a
if(c < d):
  print (c)
else:
  print(d)
X, Y = map(int, input().split())
mod = pow(10, 9) + 7

m = (2*Y - X)/3
n = (2*X - Y)/3

if m.is_integer() == False or n.is_integer() == False:
  print(0)
  exit()
if m < 0 or n < 0:
  print(0)
  exit()

def comb(n, k):
  if k > n - k:
    comb(n, n - k)
    return
  mul, div = 1, 1
  for i in range(k):
    mul = mul * (n - i) % mod
    div = div * (k - i) % mod
  return mul * pow(div, mod-2, mod)

ans = comb(int(n+m), int(n)) % mod
print(ans)

### FIXED CODE ###

X, Y = map(int, input().split())
mod = pow(10, 9) + 7

m = (2*Y - X)/3
n = (2*X - Y)/3

if m.is_integer() == False or n.is_integer() == False:
  print(0)
  exit()
if m < 0 or n < 0:
  print(0)
  exit()

def comb(n, k):
  if k > n - k:
    return comb(n, n - k)
  mul, div = 1, 1
  for i in range(k):
    mul = mul * (n - i) % mod
    div = div * (k - i) % mod
  return mul * pow(div, mod-2, mod) % mod

ans = comb(int(n+m), int(n))
print(ans)
while True:
  a,b,c,d=map(int,input().split())
  e,f,g,h=map(int,input().split())
  x=a+b+c+d
  y=e+f+g+h
  if x<y:
    print(y)
  else:
    print(x)


### FIXED CODE ###

a=list(map(int, input().split()))
b=list(map(int, input().split()))
if sum(b)<=sum(a):
  print(sum(a))
else:
  print(sum(b))
N, K = map(int, input().split())
V = list(map(int, input().split()))
ans = 0
for k in range(K+1):
    for n in range(k+1):
        if n >= N:
            break
        A = V[:n]
        A.extend(V[N-k+n:])
        A.sort()
        c = sum(A)
        for i in range(min(K-k, k)):
            if A[i] <= 0:
                c -= A[i]
        #print(k, n, c)
        ans = max(ans, c)
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
V = list(map(int, input().split()))
ans = 0
for k in range(K+1):
    for n in range(k+1):
        if n >= N or k > N:
            break
        A = V[:n]
        A.extend(V[N-k+n:])
        A.sort()
        
        c = sum(A)
        for i in range(min(K-k, k)):
            if A[i] <= 0:
                c -= A[i]
        #print(k, n, c)
        ans = max(ans, c)
print(ans)
N = int(input())
lst = []
for i in range(N):
  s, p = input().split()
  lst.append([s, p, i])
  lst_2 = sorted(lst, key = lambda x : (x[0], -1 * int(x[1])))
  
for i in lst_2:
  print(i[2] + 1)

### FIXED CODE ###

A, P = list(map(int, input().split()))
print((3 * A + P) // 2)
k = int(input())
import fractions as f
a = [1]*3
total = 0
for i in range(1,k+1):
    total += f.gcd(a[0],a[1],a[i])
for i in range(1,k+1):
    total += f.gcd(a[0],a[i],a[2])
    if i == k:
        for j in range(1,k+1):
            total += f.gcd(a[0],a[i],a[j])
for i in range(1,k):
    total += f.gcd(a[i],a[1],a[2])
    if i == k:
        for j in range(1,k+1):
            total += f.gcd(a[i],a[1],a[j])
            if j == k:
                for l in range(1,k):
                    total += f.gcd(a[i],a[l],a[j])


print(total)



### FIXED CODE ###

k = int(input())
import math
from functools import reduce
total = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            total += reduce(math.gcd,(i,j,l))

print(total)
def sup(A, j):
	if A[0] >= j:
		return 0
	l = 0
	r = len(A) - 1
	while True:
		i = (l+r) // 2
		if i == len(A) - 1 and A[i] < j:
			return len(A)
		elif A[i]<j and A[i+1]>=j:
			return i+1
		else:
			if A[i] >= j:
				r = i-1
			else: # A[i+1] < j
				l = i+1		
​
def inf(A, j): 
    if A[-1] <= j:
        return 0
    l = 0
    r = len(A) - 1
    while True:
        i = (l+r) // 2
        if i == 0 and A[i]>j:
            return len(A)
        elif A[i]>j and A[i-1]<=j:
            return len(A)-i
        else:
            if A[i] <= j:
                l = i+1
            else: # A[i-1] > j
                r = i-1		
​
N = int(input())
[A, B, C] = [sorted([int(i) for i in input().split()]) for j in range(3)]
ans = 0
for j in B:
	ans += sup(A, j) * inf(C, j)
print(ans)

### FIXED CODE ###

import sys
input=sys.stdin.readline
from bisect import bisect_right, bisect_left
n=int(input())
a = [list(map(int, input().split())) for _ in range(3)]
a[0].sort()
a[2].sort()



cnt=0
for i in range(n):
    index_1 = bisect_left(a[0],a[1][i])
    index_2 = n-bisect_right(a[2],a[1][i])
    cnt+=index_1*index_2
print(cnt)
s=input()
s = s.split("/")
if s[0] < 2019:
    print("Heisei")
if s[0] == 2019 and s[1]<= 4:
    print("Heisei")
else:
    print("TBD")

### FIXED CODE ###

s = input()
 
if s <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')
N = int(input())
if N % 2 == 0:
  print('No')
S = str(input())

s_start = S[:N//2]
s_end = S[N//2:]
is s_start == s_end:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

def main():
    N = int(input())
    S = str(input())

    if N % 2 == 1:
        print('No')
        return 0

    s_start = S[:N//2]
    s_end = S[N//2:]

    if s_start == s_end:
        print('Yes')
    else:
        print('No')
    return 0


if __name__ == '__main__':
    main()
S = int(input() S >= 10000)
s = int(input())
a = int(h = (S / 3600), m = ((S % 3600) / 60), for s in range(0, 60))
print('a')

### FIXED CODE ###

S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60

print("{0}:{1}:{2}".format(h,m,s))
import sys
N,M = map(int,input().split())
L = []
R = []

LL = L[0]
RR = R[0]
for i in range(1,M):
    if L[i]>RR or LL>R[i]:
        print(0)
        sys.exit()
    else :
        LL = max(LL,L[i])
        RR = min(RR,R[i]) 
print(RR-LL+1)




### FIXED CODE ###

import sys
N,M = map(int,input().split())
L = []
R = []
for i in range(M):
    a =list(map(int,input().split()))
    L.append(a[0])
    R.append(a[1])
LL = L[0]
RR = R[0]
for i in range(1,M):
    if L[i]>RR or LL>R[i]:
        print(0)
        sys.exit()
    elif LL>=L[i] and RR>=R[i]:
        RR=R[i]
    elif LL>=L[i] and RR<R[i]:
        continue
    elif L[i]>=LL and R[i]>=RR:
        LL = L[i]
    elif L[i]>=LL and R[i]<RR:
        continue
print(RR-LL+1)
#include<bits/stdc++.h>
#define ll long long int
 
using namespace std;
 
int main(){
  ll n;
  cin>>n;
  ll arr[n];
  ll m =1;
  for(int i=0;i<n;i++){
    cin>> arr[i];
  }
  for(int i=0;i<n;i++){
    m = m* arr[i];
  }
  if(m <=1000000000000000000)
    cout<<m<<endl;
  else
    cout<<'-1'<<endl;
  return 0;
}

### FIXED CODE ###

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

    if 0 in A:
        print(0)
        return

    ans = 1
    for a in A:
        ans *= a
        if ans > 1000000000000000000:
            print(-1)
            return

    print(ans)

main()
if S=='AAA' or S=='BBB':
  print('No')
else
  print('Yes')
  


### FIXED CODE ###

S = input()
if 'A' in S and 'B' in S:
    print('Yes')
else:
    print('No')
ops = []
kekka = []

while True:
    op = [e for e in input().split()]
    if op[1]=="?":
        break
    ops.append(op)

for i in range(len(ops)):
    if ops[i][1]=="+":
        sum = int(ops[i][0]) + int(ops[i][2])
        kekka.append(sum)
    elif ops[i][1]=="-":
        hiku = int(ops[i][0]) - int(ops[i][2])
        kekka.append(hiku)
    elif ops[i][1]=="*":
        kakeru = int(ops[i][0]) * int(ops[i][2])
        kekka.append(kakeru)
    elif ops[i][1]=="/":
        waru = floor(int(ops[i][0]) / int(ops[i][2]))
        kekka.append(waru)

for j in kekka:
    print(int(j))


### FIXED CODE ###

import math
ops = []
kekka = []

while True:
    op = [e for e in input().split()]
    if op[1]=="?":
        break
    ops.append(op)

for i in range(len(ops)):
    if ops[i][1]=="+":
        sum = int(ops[i][0]) + int(ops[i][2])
        kekka.append(sum)
    elif ops[i][1]=="-":
        hiku = int(ops[i][0]) - int(ops[i][2])
        kekka.append(hiku)
    elif ops[i][1]=="*":
        kakeru = int(ops[i][0]) * int(ops[i][2])
        kekka.append(kakeru)
    elif ops[i][1]=="/":
        waru = math.floor(int(ops[i][0]) / int(ops[i][2]))
        kekka.append(waru)

for j in kekka:
    print(int(j))
W, H, x, y, r = map(int, input().split()))
  if x - r > 0 && x + r < W:
    if y - r > 0 && y + r < H:
      print(Yes)
  else:
    print(No)

### FIXED CODE ###

W, H, x, y, r = map(int, input().split())
if r <= x <= W - r and r <= y <= H - r:
  print("Yes")
else:
  print("No")
N = list(input())

for i in N：
    if i == "7"
        print("Yes")
        break
    
else：
    print("No")

### FIXED CODE ###

N = list(input())

for i in N:
    if i == "7":
        print("Yes")
        break
    
else:
    print("No")
while True:
 x = int(input().split())

 if x[0] == 0 and x[1] == 0:
  break

 if x[0]>x[1]:
  print('%d %d' % (x[1],x[0])
 else:
  print('%d %d' % (x[0],x[1])


### FIXED CODE ###

while True:
 a,b = map(int,input().split())

 if a == 0 and b == 0:
  break

 if a>b:
  print(b,a)
 else:
  print(a,b)
num = input()
listt = input().split()

def hoge(fuga):
    new_list = []
    for int(i) in fuga:
        if i % 2 == 0:
            new_list.append(i/2)
        else:
            return False
    return new_list


count = 0
while True:
    listt = hoge(listt)
    if listt == False:
        break
    count += 1

print(count)


### FIXED CODE ###

num = input()
listt = input().split()

def hoge(fuga):
    new_list = []
    for i in fuga:
        if int(i) % 2 == 0:
            new_list.append(int(i)/2)
        else:
            return False
    return new_list


count = 0
while True:
    listt = hoge(listt)
    if listt == False:
        break
    count += 1

print(count)
M = [int(input()) for i in range(5)]
tmp = 10
for i in range(5):
  if tmp > M[i] % 10 > 0:
    tmp = M[i] % 10
    c = i
for i in range(5):
  if i != c and M[i] % 10 != 0:
    M[i] += 10 - (M[i] % 10)
print(sum(M))

### FIXED CODE ###

M = [int(input()) for i in range(5)]

a = [((i - 1) // 10 + 1) * 10 for i in M]
b = [(i - 1) % 10 for i in M]

ans = sum(a) + min(b) - 9
print(ans)