Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#AtCorder Begginer Contest 161 Christmas Eve
N,K= map(int, input().split())
Tree_List= [int(input()) for i in range(N)]
Tree_List=np.array(sorted(Tree_List))
Answer=min(Tree_List[K-1:]-Tree_List[:-(K-1)])
print(Answer)

Fixed submission:
#AtCorder Begginer Contest 161 Christmas Eve
import numpy as np
N,K= map(int, input().split())
Tree_List= [int(input()) for i in range(N)]
Tree_List=np.array(sorted(Tree_List))
Answer=min(Tree_List[K-1:]-Tree_List[:-(K-1)])
print(Answer)

Buggy python submission (verdict: Runtime Error):
#AtCorder Begginer Contest 161 Christmas Eve
N,K= map(int, input().split())
Tree_List= [int(input()) for i in range(N)]
Tree_List=np.array(sorted(Tree_List))
min(Tree_List[K-1:]-Tree_List[:-(K-1)])

Fixed submission:
#AtCorder Begginer Contest 161 Christmas Eve
import numpy as np
N,K= map(int, input().split())
Tree_List= [int(input()) for i in range(N)]
Tree_List=np.array(sorted(Tree_List))
Answer=min(Tree_List[K-1:]-Tree_List[:-(K-1)])
print(Answer)
Buggy python submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc109/tasks/abc109_b
import collections
N = int(input())
Word_List = []
SP = ""
for i in range(N):
    CW = str(input())
    if i == 0:
        Word_List.append(CW)
        SP = CW[-1]
    elif SP != CW[0]:
        break
    else:
        Word_List.append(CW)
        SP = CW[-1]
else:
    Word_List = collections.Counter(Word_List))
    if len(Word_List) != N:
        print("No")
    else:
        print("Yes")

Fixed submission:
#https://atcoder.jp/contests/abc109/tasks/abc109_b
import collections
N = int(input())
Word_List = []
SP = ""
for i in range(N):
    CW = str(input())
    if i == 0:
        Word_List.append(CW)
        SP = CW[-1]
    elif SP != CW[0]:
        print("No")
        break
    else:
        Word_List.append(CW)
        SP = CW[-1]
else:
    Word_List = collections.Counter(Word_List)
    if len(Word_List) != N:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
N_List = sorted(list(map(int,input().split())))
print(sum(N_List[1:]-N_List[:-1]))

Fixed submission:
import numpy as np
N_List = np.array(list(map(int,input().split())))
N_List_a = np.sort(N_List)
print(sum(N_List_a[1:]-N_List_a[:-1]))
Buggy python submission (verdict: Runtime Error):
moji = map(int,input().split())
print(("ABC","ABD")[moji >=1000])

Fixed submission:
moji = int(input())
print(("ABC","ABD")[moji >=1000])

Buggy python submission (verdict: Runtime Error):
A,B = map(str,input().split())
print(B+A)

Fixed submission:
moji = int(input())
print(("ABC","ABD")[moji >=1000])
Buggy python submission (verdict: Runtime Error):
N = int(input())
M_Dict = {"M":0,"A":0,"R":0,"C":0,"H":0}
for i in range(N):
    moji = str(input())
    if moji[0] in M_Dict.keys():
        M_Dict[moji[0]] += 1
M_Dict = {k: v for k, v in M_Dict.items() if v != 0}    
if len(M_Dict) < 3:
    ans = 0
else:
    ans = 0
    for k in itertools.combinations(list(M_Dict.keys()),3):
        ans += M_Dict[k[0]]*M_Dict[k[1]]*M_Dict[[2]]
    
print(ans)    

Fixed submission:
import itertools
N = int(input())
M_Dict = {"M":0,"A":0,"R":0,"C":0,"H":0}
for i in range(N):
    moji = str(input())
    if moji[0] in M_Dict.keys():
        M_Dict[moji[0]] += 1
M_Dict = {k: v for k, v in M_Dict.items() if v != 0}    
if len(M_Dict) < 3:
    ans = 0
else:
    ans = 0
    for k in itertools.combinations(list(M_Dict.keys()),3):
        ans += int(M_Dict[k[0]]) * int(M_Dict[k[1]]) * int(M_Dict[k[2]])
    
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
dp = [[]for i in range(87)] 
dp[0] = 2
dp[1] = 1

for i in range(2,87):
    dp[i] = dp[i-1]+dp[i-2]
    if i == N:
        print(dp[i])
        break
else:
    print(dp[N])

Fixed submission:
moji = str(input())
A,B,C,D = int(moji[0]),int(moji[1]),int(moji[2]),int(moji[3])

mojiretsu = str(A-B) + str(B-C) + str(C-D)
if ("00" in mojiretsu ):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
##
N = int(input())
N_List = list(map(int,input().split()))
Four_List = [i for i in N_List if i % 4 == 0]
Two_List = [i for i in N_List if i % 2 == 0]
if len(Two_List)-len(Four_List) > 0:
    N = N - (len(Two_List) - len(Four_List)) + 1

if N // 2 <= len(Four_List):
    print("Yes")
else:
    print("No")

Fixed submission:
N,M = map(int,input().split())
print((N-1)*(M-1))

Buggy python submission (verdict: Runtime Error):
##
N = int(input())
N_List = list(map(int,input().split()))
Four_List = [i for i in N_List if i % 4 == 0]
Two_List = [i for i in N_List if i % 2 == 0]
if len(Two_List) > 0:
    N = N - (len(Two_List) - len(Four_List)) + 1

if N // 2 <= len(Four_List):
    print("Yes")
else:
    print("No")

Fixed submission:
N,M = map(int,input().split())
print((N-1)*(M-1))
Buggy python submission (verdict: Runtime Error):
N = int(input())
N_List = list(map(int,input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p= (Number_NRD + Number_NRU,8)[Number_NRD +Number_NRU>=8]
min_P= (Number_NRD,1)[Number_NRD == 0]
print(str(min_p) + " " + str(max_p))

Fixed submission:
N = int(input())
N_List = list(map(int,input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p= Number_NRD + Number_NRU
min_p= (Number_NRD,1)[Number_NRD == 0]
print(str(min_p) + " " + str(max_p))

Buggy python submission (verdict: Runtime Error):
N = int(input())
N_List = list(map(int,input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p= (Number_NRD + Number_NRU,8)[Number_NRD +Number_NRU>=8]
min_P= (Number_NRD,1)[Number_NRD == 0]
print(min_p + " " + max_p)

Fixed submission:
N = int(input())
N_List = list(map(int,input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p= Number_NRD + Number_NRU
min_p= (Number_NRD,1)[Number_NRD == 0]
print(str(min_p) + " " + str(max_p))
Buggy python submission (verdict: Runtime Error):
N = int(input())
dp = [[0]*(N + 1)*100 for i in range(N + 1)]
for i in range(1,N+1):
    cs = int(input())
    dp[i][cs] = cs
    U_List = [k for k, x in enumerate(dp[i-1]) if x != 0]
    for j in U_List:
        dp[i][j+cs] = j + cs
print(max([k for k, x in enumerate(dp[-1]) if x % 10 != 0]))

Fixed submission:
N = int(input())
dp = [0]
for i in range(N):
    P = int(input())
    dp_p = list(map(lambda x:x + P,dp))
    dp = list(set(dp + dp_p))

P_List = [0] + [i for i in dp if i % 10 != 0]
print(max(P_List))
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

print((A-1)*(B-1))


Fixed submission:
L = list(map(int, input().split()))

print((L[0]-1)*(L[1]-1))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

order = input().srtip()

ret = 700
for i in order:
    if i == 'o':
        ret += 100

print(ret)


Fixed submission:
# -*- coding: utf-8 -*-

order = input()

ret = 700
for i in order:
    if i == 'o':
        ret += 100

print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

ans = 0

for a in range(1, N):
    cnt = 0
    for b in range(1, N):
        if a * b < N:
            if a < b:
                cnt += 2
            elif a == b:
                cnt += 1
        else:
            break
    
    ans += cnt

print (ans)

Fixed submission:
import math

N = int(input())

ans = 0

for a in range(1, N):
    cnt = 0
    for b in range(a, N):
        if a * b < N:
            if a < b:
                cnt += 2
            elif a == b:
                cnt += 1
        else:
            break
    ans += cnt

print (ans)
Buggy python submission (verdict: Time Limit Exceeded):
n= int(input())
A = [int(x) for x in input().split()]

ans = 1

for x in A:
        ans *= x
if ans > 10 ** 18:
        ans = -1
print(ans)

Fixed submission:
n= int(input())
A = [int(x) for x in input().split()]

ans = 1
ans_over = 0

for x in A:
        ans *= x
        if ans > 10 ** 18:
                ans = 1
                ans_over = 1

if ans_over == 1:
        if ans != 0:
                ans = -1


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()

ans = 0
_MOD = {0:1}

for i in range(len(S)):
    j = int(S[i:]) % 2019
    if j in _MOD:
        _MOD[j] = _MOD[j] + 1
    else:
        _MOD[j] = 1
        
for i in _MOD:
    m= _MOD[i]
#    ans += (_MOD[i] * (_MOD[i] - 1)) // 2
    ans += (m * (m - 1)) // 2

print(ans)

Fixed submission:
S = input()[::-1]


_MOD = {0: 1}
amari = 0
a = 1
ans = 0

for i in S:
    amari = (amari + int(i) * a) % 2019
    a = (a * 10) % 2019  #表示桁 1あたりの余
    if amari in _MOD:
        _MOD[amari] = _MOD[amari] + 1
    else:
        _MOD[amari] = 1
    
for amari in _MOD:
    m = _MOD[amari]
    ans += (m * (m - 1)) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()

ans = 0
_MOD = {0:1}

for i in range(len(S)):
    j = int(S[i:]) % 2019
    if j in _MOD:
        _MOD[j] = _MOD[j] + 1
    else:
        _MOD[j] = 1
        
for i in _MOD:
    ans += (_MOD[i] * (_MOD[i] - 1)) // 2

print(ans)

Fixed submission:
S = input()[::-1]


_MOD = {0: 1}
amari = 0
a = 1
ans = 0

for i in S:
    amari = (amari + int(i) * a) % 2019
    a = (a * 10) % 2019  #表示桁 1あたりの余
    if amari in _MOD:
        _MOD[amari] = _MOD[amari] + 1
    else:
        _MOD[amari] = 1
    
for amari in _MOD:
    m = _MOD[amari]
    ans += (m * (m - 1)) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()

ans = 0
_MOD = [0] * 2019
_MOD[0] = 1

for i in range(len(S)):
    j = int(S[i:]) % 2019
    _MOD[j] += 1

for i in range(2019):
    ans += (_MOD[i] * (_MOD[i] - 1)) // 2

print(ans)

Fixed submission:
S = input()[::-1]


_MOD = {0: 1}
amari = 0
a = 1
ans = 0

for i in S:
    amari = (amari + int(i) * a) % 2019
    a = (a * 10) % 2019  #表示桁 1あたりの余
    if amari in _MOD:
        _MOD[amari] = _MOD[amari] + 1
    else:
        _MOD[amari] = 1
    
for amari in _MOD:
    m = _MOD[amari]
    ans += (m * (m - 1)) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()

ans = 0
for j in range(len(S) - 1, 2, -1):
        for i in range(0, j - 2):            
            if (int(S[i:j + 1]) % 2019) == 0:
                ans += 1
print(ans)

Fixed submission:
S = input()[::-1]


_MOD = {0: 1}
amari = 0
a = 1
ans = 0

for i in S:
    amari = (amari + int(i) * a) % 2019
    a = (a * 10) % 2019  #表示桁 1あたりの余
    if amari in _MOD:
        _MOD[amari] = _MOD[amari] + 1
    else:
        _MOD[amari] = 1
    
for amari in _MOD:
    m = _MOD[amari]
    ans += (m * (m - 1)) // 2

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(x) for x in input().split()]

for i in range(n):
    print(A.count(i+1))

Fixed submission:
n = int(input())
A = [int(x) for x in input().split()]
ans = [0] * n

for i in range(n-1):
    ans[A[i] - 1] += 1

for i in range(n):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = [int(x) for x in input().split()]

_mod = 10 ** 9 + 7

ans = 0

for i in range(k, n + 2):
    min0 = sum(range(0,i))
    max0 = sum(range(n + 1 - i, n + 1))
        
    tota0 = max0 - min0 + 1
    ans += tota0 % _mod

print(ans % _mod)

Fixed submission:
n, k = [int(x) for x in input().split()]

_mod = 10 ** 9 + 7

ans = 0

#init
min0 = sum(range(0,k))
max0 = sum(range(n + 1 - k, n + 1))
cnt = max0 - min0 + 1
ans = cnt

for i in range(k+1 , n + 2):
#    min0 = min0 + i - 1
#    max0 = max0 + (n + 1 - i)
#    cnt  = max0 + (n + 1 - i) - (min0 + i - 1) + 1
    cnt = cnt + (n + 1 - i) - (i - 1)    
    ans += cnt % _mod

print(ans % _mod)
Buggy python submission (verdict: Runtime Error):
for i in range(n):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)

Fixed submission:
n = int(input())

ans = 0

for i in range(1,n+1):
    if (i % 3 != 0) and (i % 5 != 0):
        ans += i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

import math
ans = 0

for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            ans += math.gcd(a, math.gcd(b, c))
            

print(ans)

Fixed submission:
k = int(input())

import math


# a=b=c
# from 1 to  k  => (1+k)*k/2
ans = k * (k + 1) // 2

# a, b=c
# gcd(a,b)
for a in range(1, k):
    for b in range(a+1, k+1):
        ans += 3*2*math.gcd(a, b)

# a,b,c
for a in range(1, k-1):
    for b in range(a+1, k):
        for c in range(b+1, k+1):
            ans += 3*2*math.gcd(a, math.gcd(b, c))

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = [int(x) for x in input().split()]

if 2 * math.sqrt(a * b) < (c - a- b):
        print('Yes')
else:
    print('No')

Fixed submission:
from decimal import Decimal

a, b, c = [Decimal(x) for x in input().split()]

# math.sqrt(x: SupportsFloat) -> float
# param x: SupportsFloat

# sqrt(context: Optional[Context]=...) -> Decimal

if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []

for i in range(N):
    S += [input()]

S_KEYS = set(S)


n= 1

for key in S_KEYS:
    m = S.count(key)
    if n < m:
        n = m
        
ANS = []
for key in S_KEYS:
    if S.count(key) == n:
        ANS +=[key]

ANS= sorted(ANS)
 
for key in ANS:
        print(key)

Fixed submission:
N = int(input())
S = []

dic_={}
n = 1

for i in range(N):
    a = input()
    if a in dic_.keys():
        b = dic_.get(a) + 1
        dic_.update({a: b})
        if n < b:
            n = b
    else:
        dic_.update({a: 1})

ANS = []

for i in dic_:
    if dic_.get(i) == n:
        ANS += [i]

ANS = sorted(ANS)

for key in ANS:
        print(key)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []

for i in range(N):
    S += [input()]

S_KEYS = set(S)

ANS = []

for key in S_KEYS:
    ANS +=[S.count(key)]

n= (max(ANS))

ANS = []
for key in S_KEYS:
    if S.count(key) == n:
        ANS +=[key]

ANS= sorted(ANS)
 
for key in ANS:
        print(key)


Fixed submission:
N = int(input())
S = []

dic_={}
n = 1

for i in range(N):
    a = input()
    if a in dic_.keys():
        b = dic_.get(a) + 1
        dic_.update({a: b})
        if n < b:
            n = b
    else:
        dic_.update({a: 1})

ANS = []

for i in dic_:
    if dic_.get(i) == n:
        ANS += [i]

ANS = sorted(ANS)

for key in ANS:
        print(key)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

#初期 
SUM = sum(P[0:K])
M=0

for i in range(N - K + 1):
    _SUM=sum(P[i:i + K])
    if SUM < _SUM:
        SUM = _SUM
        M = i

EXP_V = (K + SUM)/2
print(EXP_V)

Fixed submission:
N, K = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

#初期
SUM = [0]*N
SUM[0] = sum(P[0:K])

for i in range(N - K):
    SUM[i+1] = SUM[i]-P[i] + P[i+K]

EXP_V = (K + max(SUM))/2
print(EXP_V)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

#初期 
SUM = sum(P[0:K])
M=0

for i in range(N - K + 1):
    if SUM < sum(P[i:i + K]):
        SUM = sum(P[i:i + K])
        M = i

EXP_V = (K + SUM)/2
print(EXP_V)

Fixed submission:
N, K = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

#初期
SUM = [0]*N
SUM[0] = sum(P[0:K])

for i in range(N - K):
    SUM[i+1] = SUM[i]-P[i] + P[i+K]

EXP_V = (K + max(SUM))/2
print(EXP_V)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1
B=A

if 1 in A:    
    for i in range(1,N+1):
        if i in B:
            S=B.index(i)
            B=A[S::]
            ans =N-i
        else:
            break

print(ans)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1
x=1

if 1 in A:
    ans = 0
    for i in A:
        if i ==x :
            x += 1
    ans = N - x +1
            
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1

if 1 in A:    
    for i in range(1,N+1):
        if i in A[S::]:
            S=A.index(i,S)
            ans =N-i
        else:
            break

print(ans)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1
x=1

if 1 in A:
    ans = 0
    for i in A:
        if i ==x :
            x += 1
    ans = N - x +1
            
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1

if 1 in A:    
    for i in range(1,N+1):
        if i in A[S::]:
            S=A.index(i,S)
            ans =N-i
        else:
            break

print(ans)
    

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

S=0
ans =-1
x=1

if 1 in A:
    ans = 0
    for i in A:
        if i ==x :
            x += 1
    ans = N - x +1
            
print(ans)
Buggy python submission (verdict: Runtime Error):

A,B =[int(x) for x in input().split()]

def bunkai(n):
    sosu= {1}
    tmp = n
    stop_flag = n
    
    if tmp%2 == 0:
        while tmp%2==0:
            tmp //=2
        sosu.add(2)
    
    for i in range(3,n+1,2):
        if tmp%i == 0:
            while tmp%i==0:
                tmp //=i
            sosu.add(i)
            stop_flag = tmp 
            
        if i > stop_flag:
            break
#        else:
#            stop_flag = int(stop_flag/i) 
            
    if tmp!=1:
        sosu.add(tmp)
                
    if sosu==[1]:
        sosu.add(n)
    
    return sosu

def check_sosu(n,x):
    ans=0
    tmp = n
    for i in x:
        if (tmp % i) == 0:
            ans+=1
    return ans

ans = check_sosu(B,bunkai(A))

print(ans)

Fixed submission:

N = int(input())

if N%2 ==0:
    ans=0.5
else :
    ans=(N//2 + 1)/N
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 13 22:46:19 2019

"""

N,M=( int(x) for x in input().split())
A=[int(s) for s in input().split()]

for i in range(M):
    Pmax=max(A)
    Pmax_index=A.index(max(A))
    A[Pmax_index]=int(A[Pmax_index]/2)
    
print(sum(A))

Fixed submission:
import heapq

N,M=( int(x) for x in input().split())
A=[int(s)*-1 for s in input().split()]

heapq.heapify(A)

for i in range(M):
    A_max=heapq.heappop(A)*-1
    heapq.heappush(A,(A_max//2)*-1)    
print(sum(A)*-1)
Buggy python submission (verdict: Runtime Error):
if N ==100000:
    ans=90909
elif N > 9999:  
    ans=N-9999 +909
elif N > 999:
    ans=909
elif N > 99:
    ans=N-99 +9
elif N > 9:
    ans= 9
else :
    ans=N
print(ans)   

Fixed submission:
N = int(input())

if N ==100000:
    ans=90909
elif N > 9999:  
    ans=N-9999 +909
elif N > 999:
    ans=909
elif N > 99:
    ans=N-99 +9
elif N > 9:
    ans= 9
else :
    ans=N
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = [int(x) for x in input().split()]

a = [int(input()) for x in range(m)]
_MOD = 1000000007

dp = [0] * (n + 1)
dp[0] = 1

if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(1,n):
    if (i + 1) in a:
        dp[i + 1] = 0
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % _MOD

print(dp[n])

Fixed submission:
n, m = [int(x) for x in input().split()]

#a = [int(input()) for x in range(m)]
a = set(int(input()) for x in range(m))
_MOD = 1000000007

dp = [0] * (n + 1)
dp[0] = 1

if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(1,n):
    if (i + 1) in a:
        dp[i + 1] = 0
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % _MOD

print(dp[n])
Buggy python submission (verdict: Runtime Error):
X=[int(input()) for i in range(5)]

ans=0
W=[]

for i in range(len(X)):
    if X[i]%10 == 0:
        ans+=X[i]
    else:
        ans+=(X[i]//10)*10+10
        W.append(X[i]%10)

ans +=-10+min(W)
print(ans)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

X=[A,B,C,D,E]
ans=0

Y=10

for i in range(len(X)):
    if X[i]%10 == 0:
        ans+=X[i]
    else:
        Y=min(Y,X[i]%10)
        ans+=(X[i]//10)*10+10

ans +=-10+Y
print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())

ans_list = [1]

for i in range(2,x+1):
    cnt = 2
    while True:
        tmp = i ** cnt
        if tmp > x:
            break
        ans_list += [tmp]
        cnt += 1
        
    
ans_list.sort()

for i in ans_list[::-1]:
    if i <= x:
        print(i)
        break

Fixed submission:
a, b, c, d = [int(x) for x in input().split()]

if (abs((a - b)) <= d) and (abs((c - b)) <= d) or abs(c-a) <=d :
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
SA = input()
SB = input()
SC = input()

WIN = [0, 0, 0]



card = SA[0]

SA_CNT = 1
SB_CNT = 0
SC_CNT = 0

while True:
    if card == 'a':
        SA_CNT += 1
        if SA_CNT == len (SA):
            print('A')
            break
        else:
            card = SA[SA_CNT]
    if card == 'b':
        SB_CNT += 1
        if SB_CNT == len(SB):
            print('B')
            break
        else:
            card = SB[SB_CNT]
    if card == 'c':
        SC_CNT += 1
        if SC_CNT == len (SC):
            print('C')
            break
        else:
            card = SC[SC_CNT]

Fixed submission:
SA = input()
SB = input()
SC = input()

card = SA[0]

SA_CNT = 1
SB_CNT = 0
SC_CNT = 0


while True:
    if card == 'a':
        if SA_CNT < len (SA):
            card = SA[SA_CNT]
            SA_CNT += 1
        else:
            print('A')
            break
    if card == 'b':
        if SB_CNT < len (SB):
            card = SB[SB_CNT]
            SB_CNT += 1
        else:
            print('B')
            break
    if card == 'c':
        if SC_CNT < len (SC):
            card = SC[SC_CNT]
            SC_CNT += 1
        else:
            print('C')
            break

Buggy python submission (verdict: Runtime Error):
SA = input()
SB = input()
SC = input()

WIN = [0, 0, 0]



card = SA[0]

SA_CNT = 1
SB_CNT = 0
SC_CNT = 0

while True:
    if card == 'a':
        SA_CNT += 1
        if SA_CNT == len (SA):
            print('A')
            break
        else:
            card = SA[SA_CNT]
    if card == 'b':
        SB_CNT += 1
        if SB_CNT == len(SB):
            print('B')
            break
        else:
            card = SB[SA_CNT]
    if card == 'c':
        SC_CNT += 1
        if SC_CNT == len (SC):
            print('C')
            break
        else:
            card = SC[SA_CNT]

Fixed submission:
SA = input()
SB = input()
SC = input()

card = SA[0]

SA_CNT = 1
SB_CNT = 0
SC_CNT = 0


while True:
    if card == 'a':
        if SA_CNT < len (SA):
            card = SA[SA_CNT]
            SA_CNT += 1
        else:
            print('A')
            break
    if card == 'b':
        if SB_CNT < len (SB):
            card = SB[SB_CNT]
            SB_CNT += 1
        else:
            print('B')
            break
    if card == 'c':
        if SC_CNT < len (SC):
            card = SC[SC_CNT]
            SC_CNT += 1
        else:
            print('C')
            break
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
t = n%k
print(min(t,abs(k-t)))

Fixed submission:
a, b, c = map(int, input().split())
hoge = a 
a = b
b = hoge
hoge = a
a = c
c = hoge

print(a,b,c)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
print(min(n%k, k-(n%k)))

Fixed submission:
a, b, c = map(int, input().split())
hoge = a 
a = b
b = hoge
hoge = a
a = c
c = hoge

print(a,b,c)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

t = n%k
if t > k-t:
  print(k-t)
else:
  print(t)

Fixed submission:
a, b, c = map(int, input().split())
hoge = a 
a = b
b = hoge
hoge = a
a = c
c = hoge

print(a,b,c)