Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
a=[]
A=[]

for _ in range(Q):
    a.append(int(input()))

for _ in range(N):
    A.append(int(K))

for n in range(Q):
    A[a[n]-1]+=1
    for m in range(N):
        A[m]-=1
    
for s in range(N):
    if A[s]<1:
        print("No")
    else:
        print("Yes")

Fixed submission:
N,K,Q=map(int,input().split())
a=[]
A=[]

for _ in range(Q):
    a.append(int(input()))

for _ in range(N):
    A.append(int(K))

for n in range(Q):
    A[a[n]-1]+=1
    
for s in range(N):
    if A[s]-Q<1:
        print("No")
    else:
        print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
a=[]
A=[]

for _ in range(Q):
    a.append(int(input()))

for _ in range(N):
    A.append(int(K))

for n in range(Q):
    A[a[n]-1]+=1

for _ in range(Q):
    for m in range(N):
        A[m]-=1
    
for s in range(N):
    if A[s]<1:
        print("No")
    else:
        print("Yes")

Fixed submission:
N,K,Q=map(int,input().split())
a=[]
A=[]

for _ in range(Q):
    a.append(int(input()))

for _ in range(N):
    A.append(int(K))

for n in range(Q):
    A[a[n]-1]+=1
    
for s in range(N):
    if A[s]-Q<1:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
S = input()
ans = "Yes"

for i in range(len(S)):
	if i%2 == 0:
		if !(S[i] in ('R', 'U', 'D')):
			ans = "No"
			break
	
	if i%2 == 1:
		if !(S[i] in ('L', 'U', 'D')):
			ans = "No"
			break
	
print(ans)

Fixed submission:
S = input()
ans = "Yes"

for i in range(len(S)):
	if i%2 == 0:
		if S[i] == 'L':
			ans = "No"
			break
	
	if i%2 == 1:
		if S[i] == 'R':
			ans = "No"
			break
	
print(ans)

Buggy python submission (verdict: Runtime Error):
S = input()
ans = "Yes"

for i in range(len(S)):
	if S[i]%2 == 0:
		if !(S[i] in ('R', 'U', 'D')):
			ans = "No"
			break
	
	if S[i]%2 == 1:
		if !(S[i] in ('L', 'U', 'D')):
			ans = "No"
			break
	
print(ans)

Fixed submission:
S = input()
ans = "Yes"

for i in range(len(S)):
	if i%2 == 0:
		if S[i] == 'L':
			ans = "No"
			break
	
	if i%2 == 1:
		if S[i] == 'R':
			ans = "No"
			break
	
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input)
print(N^3)

Fixed submission:
N = int(input())
print(N*N*N)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

sum = 0
for n in range(N):
       sum += B[A[n]]
       if n > 0:
         if A[n]-1 == A[n-1]:
         	sum += C[A[n-1]]
print(sum)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

sum = 0
for n in range(N):
       sum += B[A[n]-1]
       if n > 0:
         if A[n]-1-1 == A[n-1]-1:
         	sum += C[A[n-1]-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())
B = list(map(int, input().split())
C = list(map(int, input().split())

sum = 0
for n in range(N):
       sum += B[A[n]]
       if n > 0:
         if A[n]-1 == A[n-1]:
         	sum += C[A[n-1]]
print(sum)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

sum = 0
for n in range(N):
       sum += B[A[n]-1]
       if n > 0:
         if A[n]-1-1 == A[n-1]-1:
         	sum += C[A[n-1]-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
N = int (input())
A = list(map(int, input().split())
B = list(map(int, input().split())
C = list(map(int, input().split())

sum = 0
for n in range(N):
       sum += B[A[n]]
       if n > 0:
         if A[n]-1 == A[n-1]:
         	sum += C[A[n-1]]
print(sum)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

sum = 0
for n in range(N):
       sum += B[A[n]-1]
       if n > 0:
         if A[n]-1-1 == A[n-1]-1:
         	sum += C[A[n-1]-1]
print(sum)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for n in range(3):
  if S[n] = T[n]:
    count += 1
print(count)


Fixed submission:
S = input()
T = input()
count = 0
for n in range(3):
  if S[n] == T[n]:
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for n inrange(3):
  if S[n] = T[n]:
    count += 1
print(count)


Fixed submission:
S = input()
T = input()
count = 0
for n in range(3):
  if S[n] == T[n]:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = map(int, input().split())

max = 0
count = 0
for n in range(N-1):
  if H[n] >= H[n+1]:
    count += 1
  else:
    if count > max:
      max = count
    count = 0
print(max)

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

max = 0
count = 0
for n in range(N-1):
  if H[n] >= H[n+1]:
    count += 1
    if count > max:
      max = count
  else:
    count = 0
print(max)

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

max = 0
count = 0
for n in range(N-1)
  if H[n] >= H[n+1]:
    count += 1
  else:
    if count > max:
      max = count
    count = 0
print(max)

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

max = 0
count = 0
for n in range(N-1):
  if H[n] >= H[n+1]:
    count += 1
    if count > max:
      max = count
  else:
    count = 0
print(max)

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = map(int, input().solit())

max = 0
count = 0
for n in range(N-1)
  if H[n] >= H[n+1]:
    count += 1
  else:
    if count > max:
      max = count
    count = 0
print(max)

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

max = 0
count = 0
for n in range(N-1):
  if H[n] >= H[n+1]:
    count += 1
    if count > max:
      max = count
  else:
    count = 0
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

def get_integers(whitespaced_string):
    cleaned_string = whitespaced_string.split(" ")

    formatted_numbers = []
    for number in cleaned_string:
        formatted_numbers.append(int(number))
    
    return tuple(formatted_numbers)

input_arg = get_integers(s)

def get_answers(index = 2):

    answers = []
    for i in range(input_arg[index]):
        answers.append(int(input()))

    return answers

score_card = [input_arg[1] for i in range(input_arg[0])]
answers = get_answers()

for answer in answers:
    for i in range(1, len(score_card) + 1):
        if answer != i:
            score_card[i-1] -= 1

for i in score_card:
    if i <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
import sys

N,K,Q = map(int,input().split())
A = (int(x) for x in sys.stdin.read().split())
 
score = [K-Q] * (N+1) 
for x in A:
    score[x] += 1
 
answer = '\n'.join('No' if x <= 0 else 'Yes' for x in score[1:])
print(answer)

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

def get_integers(whitespaced_string):
    cleaned_string = whitespaced_string.split(" ")

    formatted_numbers = []
    for number in cleaned_string:
        formatted_numbers.append(int(number))
    
    return tuple(formatted_numbers)

input_arg = get_integers(s)

def get_answers(index = 2):

    answers = []
    for i in range(input_arg[index]):
        answers.append(int(input()))

    return answers

def compute_score(index = 0):
    answers = get_answers()

    for i in range(1, input_arg[index] + 1):
        initial_score = input_arg[index + 1]
        for j in answers:
            if j != i:
                initial_score -= 1
        if initial_score <= 0:
            print("No")
        else:
            print("Yes")

compute_score()

Fixed submission:
import sys

N,K,Q = map(int,input().split())
A = (int(x) for x in sys.stdin.read().split())
 
score = [K-Q] * (N+1) 
for x in A:
    score[x] += 1
 
answer = '\n'.join('No' if x <= 0 else 'Yes' for x in score[1:])
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

# 以下を割引券の枚数分繰り返す
# 品物の値段を高い順にソート
# 最も高い品物に割引券を1枚使う
for i in range(M):
	A.sort(reverse=True)
	A[0] = math.floor(A[0] / 2)

print(sum(A))

Fixed submission:
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(A)

# 以下を割引券の枚数分繰り返す
# 最も高い品物に割引券を1枚使う
for _ in range(M):
	min = heapq.heappop(A)
	heapq.heappush(A, (-1) * (-min // 2))

print(-sum(A))
Buggy python submission (verdict: Time Limit Exceeded):
def get_answer(input_list):
    c_list = [int(v) for v in input_list[0].split(" ")]
    n = c_list[0]
    k = c_list[1]
    q = c_list[2]
    a = [int(v) for v in input_list[1:]]
    ns = [k] * n
    for aa in a:
        index = aa - 1
        for i in range(len(ns)):
            if i != index:
                ns[i] -= 1

    nr = [""] * n
    for i in range(len(ns)):
        if ns[i] <= 0:
            nr[i] = "No"
        else:
            nr[i] = "Yes"

    return nr



if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    for a in get_answer(input_list):
        print(a)


Fixed submission:
def get_answer(input_list):
    c_list = [int(v) for v in input_list[0].split(" ")]
    n = c_list[0]
    k = c_list[1]
    q = c_list[2]
    a = [int(v) for v in input_list[1:]]
    ns = [k - q] * n
    for aa in a:
        index = aa - 1
        ns[index] += 1
        """
        for i in range(len(ns)):
            if i != index:
                ns[i] -= 1
        """

    nr = [""] * n
    for i in range(len(ns)):
        if ns[i] <= 0:
            nr[i] = "No"
        else:
            nr[i] = "Yes"

    return nr



if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    for a in get_answer(input_list):
        print(a)
Buggy python submission (verdict: Runtime Error):
def get_answer(ki):
    n = int(ki[0].split(" ")[0])
    q = int(ki[0].split(" ")[1])
    n_data = [[int(k[0]), int(k[1])] for k in [k.split(" ") for k in ki[1:-q]]]
    q_data = [[int(k[0]), int(k[1])] for k in [k.split(" ") for k in ki[-q:]]]
    tree = make_tree(n, n_data)

    score = [0] * n

    for qq in q_data:
        index = qq[0]
        add_score(tree, score, qq, n_data, index)

    #score = [str(s) for s in score]
    #s = " ".join(score)
    for s in score:
        print(s, end="")
        print(" ", end="")

    return None


def add_score(tree, score, qq, n_data, index):
    score[index - 1] += qq[1]
    next_index = tree[index -1]
    for n_i in next_index:
        add_score(tree, score, qq, n_data, n_i)


def make_tree(n, n_data):
    r = {}
    for i in range(n):
        r[i] = []
    for n in n_data:
        k = n[0] - 1
        if k in r.keys():
            r[k].append(n[1])
        else:
            r[k] = [n[1]]
    return r


def make_index(n, tree):
    index = {}
    r0 = [0] * n
    for i in range(n):
        r0[i] = i
    index[0] = r0

    for i in range(1, n):
        r = []
        add_index(tree, i, r)
        index[i] = r

    return index


def add_index(tree, index, r):
    r.append(index)
    next_index = tree[index]
    for n_i in next_index:
        add_index(tree, n_i - 1, r)


if __name__ == "__main__":
    input_ki = []
    while True:
        try:
            input1 = input()
            if not input1:
                break;
            if len(input1) == 0:
                break;
            input_ki.append(input1)
        except EOFError:
            break
    get_answer(input_ki)


Fixed submission:


def get_answer(a, s):
    a = int(a)
    if a >= 3200:
        return s
    return "red"


if __name__ == "__main__":
    input1 = input()
    input2 = input()
    print(get_answer(input1, input2))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np


def get_answer(n, a):
    n = int(n)
    a = [int(v) for v in a.split(" ")]
    indexes_all = create_index(n)
    v_max = -1
    for indexes in indexes_all:
        v = a[indexes[0]]
        for i in range(1, len(indexes)):
            v = (v + a[indexes[i]]) / 2
        if v > v_max:
            v_max = v
    return v_max


def create_index(n):
    ret_all = []
    index_queue = np.arange(0, n)
    ret = []
    search_index(index_queue, ret_all, ret, n)
    return ret_all


def search_index(index_q, ret_all, ret, n):
    if n <= 0:
        ret_all.append(list(ret))
        return
    for i in range(n):
        index = index_q[i]
        index_q = np.delete(index_q, i)
        ret.append(index)
        search_index(index_q, ret_all, ret, n - 1)
        index_q = np.insert(index_q, i, index)
        ret.pop()


if __name__ == "__main__":
    input1 = input()
    input2 = input()
    print(get_answer(input1, input2))


Fixed submission:
def sort_index(a):
    for i in range(len(a)):
        for j in range(i + 1, len(a)):
            if a[i] > a[j]:
                a[i], a[j] = a[j], a[i]
    return a


def get_answer(n, a):
    n = int(n)
    a = [int(v) for v in a.split(" ")]
    a = sort_index(a)
    v_max = 0
    v = a[0]
    for i in range(1, len(a)):
        v = (v + a[i]) / 2
    if v > v_max:
        v_max = v
    return v_max



if __name__ == "__main__":
    input1 = input()
    input2 = input()
    print(get_answer(input1, input2))
Buggy python submission (verdict: Runtime Error):
def get_answer(input_list):
    so = input_list[0]
    s = so[0]
    s_index = 1
    s_len = len(so)
    t = input_list[1]
    ret = -1

    """
    """
    for i in range(1000):
        find_flag = True
        ss = s
        for tt in t:
            ii = ss.find(tt)
            if ii < 0:
                find_flag = False
                break
            ss = ss[ii + 1:]
        if find_flag:
            ret = len(s)
            break
        s += so[s_index]
        s_index = (s_index + 1) % s_len

    return ret


if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    print(get_answer(input_list))


Fixed submission:
def get_answer(input_list):
    so = input_list[0]
    t = input_list[1]

    s_len = len(so)

    """
    contest son
    s:5
    o:1 7+2
    n:2 7+3
    
    aabbcc abca
    a:0 0
    b:2 2
    c:4 4
    a:0 0 +6
    
    aa aaaa
    a:0
    a:1
    a:0 + 2
    a:1 + 2   
    
    aabbcc abccba
    a 0
    b 2
    c 4
    c 5
    b 2 6
    a 0 12 = 13
    """

    t_i = [-1] * len(t)
    s = so + so
    s_index = 0
    for i in range(len(t)):
        index = s.find(t[i], s_index)
        if index < 0:
            break
        index = index % s_len
        t_i[i] = index
        s_index = index + 1
        s_index = s_index % s_len

    if -1 in t_i:
        return -1


    t_len = len(t_i)
    ret = 0 #len(t_i)
    ret_i = 0
    for i in range(t_len):
        t1 = t_i[i]
        ret = t1
        if i < t_len - 1:
            t2 = t_i[i + 1]
            if t1 >= t2:
                ret_i += 1


    """
    for i in range((1000 - s_index) * s_len):
        find_flag = True
        ss = s
        for tt in t:
            ii = ss.find(tt)
            if ii < 0:
                find_flag = False
                break
            ss = ss[ii + 1:]
        if find_flag:
            ret = len(s)
            break
        s += so[s_index]
        s_index = (s_index + 1) % s_len
    """
    return ret_i * s_len + ret + 1

# b33 179
if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    print(get_answer(input_list))
Buggy python submission (verdict: Runtime Error):
print("Yes" if 9 in input() else "No")

Fixed submission:
print("Yes" if '9' in input() else "No")
Buggy python submission (verdict: Runtime Error):
    a,b=map(int,input().split())
    if a<b:
        print("0")
    else:
        print(a-b)

Fixed submission:
a,b=map(int,input().split())
if a<b:
    print("0")
else:
    print(a-b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
array=list(map(int,input().split()))
ans=0
flag=0
for i in range(len(array)):
    if i+1==array[i]:
        if flag==0:
            ans+=1
            if(i<len(array)-1&&array[i+1]==i+2):
                flag=1
        else:
            flag=0
print(ans)

Fixed submission:
n=int(input())
array=list(map(int,input().split()))
ans=0
flag=0
for i in range(len(array)):
    if i+1==array[i]:
        if flag==0:
            ans+=1
            if(i<len(array)-1 and array[i+1]==i+2):
                flag=1
        else:
            flag=0
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
import functools

n=int(input())
t=[]
for i in range(n):
	t.append(int(input()))
ans=functools.reduce(a*b//fractions.gcd(a,b),t)
print(ans)

Fixed submission:
def gcd(a,b) :
    if a % b == 0 :
    	return b
    return gcd(b,a%b)
     
def lcm(a,b) :
    return a//gcd(a,b)*b
     
N = int(input())
res = 1
for i in range(N) :
    res = lcm(res, int(input()))
print(res)
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(input())
print((n-1)*(m-1))

Fixed submission:
a,b=map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
today = input()
if today == "Sunny":
	print("Cloudy")
elif today == "Cloudy":
	print("Rainy")
elif today == "Rainy":
    print("Sunny”)


Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
today = input()
if today == "Sunny":
	print("Cloudy")
elif today == "Cloudy":
	print("Rainy")
elif today == "Rainy":
    print("Sunny”)


Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
S = input()

if S == 'Sunny':
	print('Cloudy')
else if S == 'Cloudy':
	print('Rainy')
else if S == 'Rainy':
	print('Sunny')


Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
S = input()
if S == 'Sunny':
  print('Cloudy')
else if S == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')


Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
S = input()
if S == 'Sunny':
  print 'Cloudy'
else if S == 'Cloudy':
  print 'Rainy'
else:
  print 'Sunny'

Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
input = S
if(input = 'Sunny'):
  print('Rainy')
else if(input = 'Cloudy'):
  print('Sunny')
else:
  print('Cloudy')


Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
input = S
if(input = 'Sunny'):
  print('Cloudy')
else if(input = 'Cloudy'):
  print('Rainy')
else:
  print('Sunny')


Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
input = S
if(input = 'Sunny'):
  print('Cloudy')
else if(input = 'Cloudy'):
  print('Rainy')
else:
  print('Sunny')

Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy python submission (verdict: Runtime Error):
input = S
if(input = 'Sunny')
  print('Cloudy')
else if(input = 'Cloudy')
  print('Rainy')
else
  print('Sunny')

Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
Buggy python submission (verdict: Runtime Error):
z,b,c=map(int,input().split())
print(c-max((a-b),c))

Fixed submission:
a,b,c=map(int,input().split())
print(c-min(a-b,c))
Buggy python submission (verdict: Runtime Error):
#include<stdio.h>

int judge(int a, int b)
{
    if(a < b)
    {
        return 0;
    }
    else if(a >= b)
    {
        return 10;
    }
    else
    {
        return 2;
    }
}

int main()
{
    int a, b;
    scanf("%i %i", &a, &b);
    int re = judge(a, b);
    printf("%i\n", re);
}


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

def f(a, b):
    if a < b:
        return 0
    elif a >= b:
        return 10

print(f(a, b))

Buggy python submission (verdict: Runtime Error):
#include<stdio.h>

int judge(int a, int b)
{
    if(a < b)
    {
        return 0;
    }
    else if(a >= b)
    {
        return 10;
    }
    return 0;
}

int main()
{
    int a, b;
    scanf("%i %i", &a, &b);
    int re = judge(a, b);
    printf("%i\n", re);
}


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

def f(a, b):
    if a < b:
        return 0
    elif a >= b:
        return 10

print(f(a, b))
Buggy python submission (verdict: Runtime Error):
N = int(input("店舗数"))

list = []
for i in range(N):
    s, p = input().split()
    P = 100 - int(p)
    list.append((s,P,i+1))

list.sort()

for a in list:
    print(a[2])
    

Fixed submission:
a, p = map(int, input().split())

re = int((a*3 + p) / 2)

print(re)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
ans = 0

if A > B:
    ans = A + (A - 1)
elif A == B:
    ans = A + B
elif A < B:
    ans = B + (B - 1)

print(ans)

Fixed submission:
A, B = map(int, input().split())
ans = 0

if A > B:
    ans = A + (A - 1)
elif A == B:
    ans = A + B
elif A < B:
    ans = B + (B - 1)

print(ans)
Buggy python submission (verdict: Runtime Error):
list_1 = []
list_2 = []
list_3 = []

for i in range(5):
    list_1.append(input())

for i in range(5):
    list_2.append(int(list_1[i]) % 10)

for i in range(5):
    if list_2[i] != 0:
        list_3.append(-(list_2[i] - 10))
    else:
        list_3.append(0)

max_num = 0
for i in range(5):
    if list_3[i] > max_num:
        max_num = list_3[i]
        max_num_2 = i

a1 = int(list_1.pop(max_num_2))
a2 = int(list_3.pop(max_num_2))

ans = 0

for i in range(4):
    ans += int(list_1[i])
    ans += list_3[i]

ans += a1

print(ans)


Fixed submission:
list_1 = []
list_2 = []
list_3 = []

for i in range(5):
    list_1.append(input())

for i in range(5):
    list_2.append(int(list_1[i]) % 10)

for i in range(5):
    if list_2[i] != 0:
        list_3.append(-(list_2[i] - 10))
    else:
        list_3.append(0)

max_num = 0
max_num_2 = 0
for i in range(5):
    if list_3[i] > max_num:
        max_num = list_3[i]
        max_num_2 = i

a1 = int(list_1.pop(max_num_2))
a2 = int(list_3.pop(max_num_2))

ans = 0

for i in range(4):
    ans += int(list_1[i])
    ans += list_3[i]

ans += a1

print(ans)