Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = 0
for i in range(3):
    val += A[i]
if val == 0:
    flag = True

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')

Fixed submission:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = 0
for i in range(3):
    val += A[i][i]
if val == 0:
    flag = True

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = 0
for i in range(3):
    val += A[i]
if val == 0:
    flag True

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')

Fixed submission:
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = 0
for i in range(3):
    val += A[i][i]
if val == 0:
    flag = True

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(1, N+1):
    print(A.index(i)+1, end=' ')

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
rev = [0] * N
for i in range(N):
    rev[A[i]-1] = i+1
print(*rev)
Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0

for i in range(N):
    x -= a[i]
    if x < 0:
        break
    else:
        s += 1

print(cnt if x <= 0 else cnt-1)

Fixed submission:
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0

for i in range(N):
    x -= a[i]
    if x < 0:
        break
    else:
        cnt += 1

print(cnt if x <= 0 else cnt-1)
Buggy python submission (verdict: Runtime Error):
if X < A:
  print(0)
else:
  print(10)

Fixed submission:
X, A = map(int, input().split())
if X < A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))

count = 1
position = 0

while position <= X:
    position += L.pop(0)
    if position <= X:
        count += 1

print(count)

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

count = 1
position = 0

while L and position <= X:
    position += L.pop(0)
    if position <= X:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())

ball_position = []
for _ in range(N):
    i, j = map(int, input().split())
    ball_position.append((i, j))

def tuple_inverse(a):
    ai, aj = a
    if ai < 0:
        return (-ai, -aj)
    return(ai, aj)

def tup2_diff(a, b):
    ai, aj = a
    bi, bj = b
    return tuple_inverse((ai - bi , aj - bj))

calculation_list = []
for i in range(len(ball_position)):
    for j in range(i + 1, len(ball_position)):
        calculation_list.append(tup2_diff(ball_position[i], ball_position[j]))
        
import collections
c = collections.Counter(calculation_list).most_common(1)

print(N - calculation_list.count(c[0][0]))

Fixed submission:
N = int(input())

ball_position = []
for _ in range(N):
    i, j = map(int, input().split())
    ball_position.append((i, j))

    
def tup2_diff(a, b):
    ai, aj = a
    bi, bj = b
    return ((ai - bi, aj - bj))
  
calculation_list = []
for i in range(len(ball_position)):
    for j in range(len(ball_position)):
        if i == j:
            continue
        else:
            x , y = tup2_diff(ball_position[i], ball_position[j])
            if x > 0 or (x == 0 and y > 0):
                calculation_list.append((x, y))
           
import collections

c = collections.Counter(calculation_list).most_common(1)
if N == 1:
    print(1)
else:
    print(N - calculation_list.count(c[0][0]))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

set_ID = {i for i in range(N)}

for _ in range(M):
    L, R = map(int, input().split())
    set_M = {i for i in range(L - 1, R)}
    set_ID = set_ID & set_M
    
print(len(set_ID))

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

L_limit = 1
R_limit = N
for _ in range(M):
    L, R = map(int, input().split())
    L_limit = max(L_limit, L)
    R_limit = min(R_limit, R)
    
print(max(R_limit - L_limit + 1, 0))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A_list = list(map(int, input().split()))

A_sorted = sorted(A_list)

CB_list = []
for _ in range(M):
    B, C = map(int, input().split())
    CB_list.append((C, B))
    
CB_reverse_sorted = sorted(CB_list, reverse=True)

pointer = 0

for CB_tuple in CB_reverse_sorted:
    C = CB_tuple[0]
    B = CB_tuple[1]
    
    for i in range(pointer, pointer + B):
        if i >= N:
            continue
            
        if A_sorted[i] < C:
            A_sorted[i] = C
            
    pointer += B

print(sum(A_sorted))

Fixed submission:
N, M = map(int, input().split())
A_list = list(map(int, input().split()))
 
A_sorted = sorted(A_list)
 
CB_list = []
for _ in range(M):
    B, C = map(int, input().split())
    CB_list.append((C, B))
    
CB_reverse_sorted = sorted(CB_list, reverse=True)
 
bflag = False
pointer = 0

for CB_tuple in CB_reverse_sorted:
    C = CB_tuple[0]
    B = CB_tuple[1]
    
    for i in range(pointer, pointer + B):
        if i >= N or A_sorted[i] > C:
            bflag = True
            break
            
        if A_sorted[i] < C:
            A_sorted[i] = C
            
    pointer += B
    
    if bflag == True:
        break

print(sum(A_sorted))
Buggy python submission (verdict: Runtime Error):
N = int(input())

def divisor(N):
    '''
    create divisor_list < sqrt(N) from natural number
    '''
    divisor_list = []
    
    for num in range(1, math.ceil(math.sqrt(N)) + 1):
        if N % num == 0:
            divisor_list.append(num)
    
    return divisor_list
    
def F(A, B):
    return max(len(str(A)), len(str(B)))
  
def minimumF(N):
    factoring_list = divisor(N)
    
    candidate_list = []
    
    for A in factoring_list:
        B = N // A
        candidate_list.append(F(A, B))
        
    return min(candidate_list)
  
print(minimumF(N))

Fixed submission:
import math

N = int(input())
 
def divisor(N):
    '''
    create divisor_list < sqrt(N) from natural number
    '''
    divisor_list = []
    
    for num in range(1, math.ceil(math.sqrt(N)) + 1):
        if N % num == 0:
            divisor_list.append(num)
    
    return divisor_list
    
def F(A, B):
    return max(len(str(A)), len(str(B)))
  
def minimumF(N):
    factoring_list = divisor(N)
    
    candidate_list = []
    
    for A in factoring_list:
        B = N // A
        candidate_list.append(F(A, B))
        
    return min(candidate_list)
  
print(minimumF(N))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())

Adj_matrix = np.zeros((N, N))
for _ in range(N):
    a, b = map(int, input().split())
    Adj_matrix[a - 1, b - 1] += 1
    Adj_matrix[b - 1, a - 1] += 1
    
def initialize():
    explored_list = np.zeros((N, 1))
    return explored_list
  
def is_move(vertex, explored_list, Adj_martrix):
    for i in range(len(explored_list)):
        if explored_list[i] == 0 and Adj_martrix[vertex - 1, i] == 1:
            return True
    return False
  
import copy

g_count = 0

def graph_exp(vertex, explored_list, Adj_matrix):
    global g_count
    
    explored_list[vertex - 1] += 1
    
    # Recursive End
    if not is_move(vertex, explored_list, Adj_matrix):
        g_count += all(explored_list)
        return 0
    
    # Recursive Call
    for i in range(len(explored_list)):
        if explored_list[i] == 0 and Adj_matrix[vertex - 1, i] == 1:
            graph_exp(i + 1, copy.copy(explored_list), Adj_matrix)
    
explored_list = initialize()

graph_exp(1, explored_list, Adj_matrix)

print(g_count)

Fixed submission:
import numpy as np
N, M = map(int, input().split())
 
Adj_matrix = np.zeros((N, N))
for _ in range(M):
    a, b = map(int, input().split())
    Adj_matrix[a - 1, b - 1] += 1
    Adj_matrix[b - 1, a - 1] += 1
    
def initialize():
    explored_list = np.zeros((N, 1))
    return explored_list
  
def is_move(vertex, explored_list, Adj_martrix):
    for i in range(len(explored_list)):
        if explored_list[i] == 0 and Adj_martrix[vertex - 1, i] == 1:
            return True
    return False
  
import copy
 
g_count = 0
 
def graph_exp(vertex, explored_list, Adj_matrix):
    global g_count
    
    explored_list[vertex - 1] += 1
    
    # Recursive End
    if not is_move(vertex, explored_list, Adj_matrix):
        g_count += all(explored_list)
        return 0
    
    # Recursive Call
    for i in range(len(explored_list)):
        if explored_list[i] == 0 and Adj_matrix[vertex - 1, i] == 1:
            graph_exp(i + 1, copy.copy(explored_list), Adj_matrix)
    
explored_list = initialize()
 
graph_exp(1, explored_list, Adj_matrix)
 
print(g_count)
Buggy python submission (verdict: Runtime Error):
import itertools

white_num_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 
N, K = map(int, input().split())
black_num_list = list(map(int, input().split()))
 
white_num_list = list(set(white_num_list).difference(set(black_num_list)))
num_combination = list(itertools.combinations_with_replacement(white_num_list, len(str(N))))
 
num_list = []
for num in num_combination:
    if num[0] == 0:
        continue
    num_list.append(int(''.join(map(str, num))))
 
num_list = sorted(num_list)
 
def price(N, num_list, white_num_list):
    for num in num_list:
        if num >= N:
            return num
    
    if 0 in white_num_list:
        white_num_list.remove(0)
    placeholder = str(min(white_num_list))
    return int(placeholder * (len(str(N)) + 1))
  
print(price(N, num_list, white_num_list))

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

count_5 = 0
count_7 = 0

#aについて
if a == 5:
	count_5 += 1
elif a == 7:
	count_7 += 1

#bについて
if b == 5:
	count_5 += 1
elif b == 7:
	count_7 += 1

#cについて
if c == 5:
	count_5 += 1
elif c == 7:
	count_7 += 1

if count_5 == 2 and count_7 == 1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
white_num_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

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

white_num_list = list(set(white_num_list).difference(set(black_num_list)))
num_combination = list(itertools.combinations_with_replacement(white_num_list, len(str(N))))

num_list = []
for num in num_combination:
    if num[0] == 0:
        continue
    num_list.append(int(''.join(map(str, num))))

num_list = sorted(num_list)

def price(N, num_list, white_num_list):
    for num in num_list:
        if num >= N:
            return num
    
    if 0 in white_num_list:
        white_num_list.remove(0)
    placeholder = str(min(white_num_list))
    return int(placeholder * (len(str(N)) + 1))
  
print(price(N, num_list, white_num_list))

Fixed submission:
import itertools
 
white_num_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
N, K = map(int, input().split())
black_num_list = list(map(int, input().split()))
 
white_num_list = list(set(white_num_list).difference(set(black_num_list)))
num_combination = list(itertools.product(white_num_list, repeat = len(str(N))))
 
num_list = []
for num in num_combination:
    if num[0] == 0:
        continue
    num_list.append(int(''.join(map(str, num))))
    
num_list = sorted(num_list)
 
def price(N, num_list, white_num_list):
    for num in num_list:
        if num >= N:
            return num
    
    placeholder = str(min(white_num_list)) * (len(str(N)) + 1)
    if placeholder[0] == '0':
        white_num_list.remove(0)
        placeholder = str(min(white_num_list)) + placeholder[1:]
    return int(placeholder)
      
print(price(N, num_list, white_num_list))
Buggy python submission (verdict: Time Limit Exceeded):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
tickets = {}
for _ in range(M):
    x, y, c = map(int, input().split())
    if (x, y) in tickets:
        if tickets[(x, y)] < c:
            tickets[(x, y)] = c
    else:
        tickets[(x, y)] = c

min_price = float("inf")
for i, price_a in enumerate(a, 1):
    for j, price_b in enumerate(b, 1):
        total_price = price_a + price_b
        if (i, j) in tickets:
            total_price -= tickets[(i, j)]
        if min_price > total_price:
            min_price = total_price

print(min_price)

Fixed submission:
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

min_price = min(a) + min(b)
for _ in range(M):
    x, y, c = map(int, input().split())
    discount_price = a[x-1] + b[y-1] - c
    if min_price > discount_price:
        min_price = discount_price
        
print(min_price)
Buggy python submission (verdict: Runtime Error):
times = [int(input()) for _ in range(5)]

rem = float("inf")
last = 0
for time in times:
    if time % 10 < rem and time % 10 != 0:
        rem = time % 10
        last = time
times.remove(last)

total_time = 0
for time in times:
    if time % 10 == 0:
        total_time += time
    else:
        total_time += time + (10 - time % 10)
total_time += last

print(total_time)

Fixed submission:
times = [int(input()) for _ in range(5)]

total_time = 0
while times:
    if len(times) != 1:
        for i in range(len(times)):
            if times[i] % 10 == 0:
                total_time += times[i]
                times.remove(times[i])
                break
        else:
            rem = 0
            re_time = 0
            for time in times:
                if time % 10 > rem:
                    rem = time % 10
                    re_time = time
            total_time += re_time + (10 - rem)
            times.remove(re_time)
    else:
        total_time += times.pop()
        
print(total_time)

Buggy python submission (verdict: Runtime Error):
times = [int(input()) for _ in range(5)]

rem = float("inf")
last = 0
for time in times:
    if time % 10 < rem and time % 10 != 0:
        rem = time % 10
        last = time
times.remove(last)

total_time = 0
for time in times:
    if time % 10 == 0:
        total_time += time
    else:
        total_time += time + (10 - time % 10)
total_time += last

print(total_time)

Fixed submission:
times = [int(input()) for _ in range(5)]

total_time = 0
while times:
    if len(times) != 1:
        for i in range(len(times)):
            if times[i] % 10 == 0:
                total_time += times[i]
                times.remove(times[i])
                break
        else:
            rem = 0
            re_time = 0
            for time in times:
                if time % 10 > rem:
                    rem = time % 10
                    re_time = time
            total_time += re_time + (10 - rem)
            times.remove(re_time)
    else:
        total_time += times.pop()
        
print(total_time)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())

for i in range(A, B+1):
    if A <= i <= A + K - 1 or B - K + 1 <= i <= B:
        print(i)

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

for i in range(A, min(B, A + K - 1) + 1):
    print(i)
for i in range(max(B - K + 1, A + K), B + 1):
    print(i)
Buggy python submission (verdict: Runtime Error):
nums = list(map(int, list(input())))

flag = 7
while flag >= 0:
    S = []
    total = nums[0]
    for i, bit in enumerate(bin(flag)[2:], 1):
        if int(bit):
            total += nums[i]
            S.append("+")
        else:
            total -= nums[i]
            S.append("-")
    if total == 7:
        break
    
    flag -= 1

print(f"{nums[0]}{S[0]}{nums[1]}{S[1]}{nums[2]}{S[2]}{nums[3]}=7")

Fixed submission:
nums = list(map(int, list(input())))

flag = 7
while flag >= 0:
    S = []
    total = nums[0]
    bin_str = format(flag, "03b")
    for i, bit in enumerate(bin_str, 1):
        if int(bit):
            total += nums[i]
            S.append("+")
        else:
            total -= nums[i]
            S.append("-")
    if total == 7:
        break
    
    flag -= 1
print(f"{nums[0]}{S[0]}{nums[1]}{S[1]}{nums[2]}{S[2]}{nums[3]}=7")

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


def check():
    for i in [1, 0]:
        total = A
        if i:
            total += B
        else:
            total -= B
        for j in [1, 0]:
            if j:
                total += C
            else:
                total -= C
            for k in [1, 0]:
                if k:
                    total += D
                else:
                    total -= D
    
                if total == 7:
                    return [i, j, k]

S = []
for s in check():
    if s:
        S.append("+")
    else:
        S.append("-")

print(f"{A}{S[0]}{B}{S[1]}{C}{S[2]}{D}=7")

Fixed submission:
nums = list(map(int, list(input())))

flag = 7
while flag >= 0:
    S = []
    total = nums[0]
    bin_str = format(flag, "03b")
    for i, bit in enumerate(bin_str, 1):
        if int(bit):
            total += nums[i]
            S.append("+")
        else:
            total -= nums[i]
            S.append("-")
    if total == 7:
        break
    
    flag -= 1
print(f"{nums[0]}{S[0]}{nums[1]}{S[1]}{nums[2]}{S[2]}{nums[3]}=7")
Buggy python submission (verdict: Time Limit Exceeded):
H,W=map(int,input().split())

L=[]
for i in range(1,H+1):
  for j in range(1,W+1):
    L.append([i+j,i-j])

conn =[[2,0]]
prev=0
while(prev!=len(conn)):
  prev=len(conn)
  temp=[]
  for i in range(len(conn)):
    for j in range(len(L)):
      if (L[j][0]-conn[i][0])*(L[j][1]-conn[i][1])==0:
        if 1-(L[j] in temp):
          temp.append(L[j])
  for i in range(len(temp)):
    conn.append(temp[i])
    L.remove(temp[i])
print(len(conn)-1)

Fixed submission:
H,W=map(int,input().split())
import math

A=[0,math.ceil(W/2)]
if (H-1)*(W-1)!=0:
  c=W*math.floor(H/2)+A[H%2]
else:
  c=1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K,Q=map(int,input().split())
A=[int(input()) for i in range(Q)]
if K-Q<=0:
  L=Q-K
  for i in range(N):
    if A.count(i+1)>L:
      print('Yes')
    else:
      print('No')
else:
  for i in range(N):
    print('Yes')

Fixed submission:
import numpy as np
N,K,Q=map(int,input().split())
A=[int(input()) for i in range(Q)]

if K-Q<=0:
  L=[K-Q for i in range(N)]
  for i in range(Q):
    L[A[i]-1]=L[A[i]-1]+1
  for i in range(N):
    if L[i]>0:
      print('Yes')
    else:
      print('No')
else:
  for i in range(N):
    print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K,Q=map(int,input().split())
A=[int(input()) for i in range(Q)]
C=np.ones(N)
B=np.zeros(N)+K
for i in range(Q):
  B=B-C
  B[A[i]-1]=B[A[i]-1]+1
for i in range(N):
  if B[i]>0:
    print('Yes')
  else:
    print('No')

Fixed submission:
import numpy as np
N,K,Q=map(int,input().split())
A=[int(input()) for i in range(Q)]

if K-Q<=0:
  L=[K-Q for i in range(N)]
  for i in range(Q):
    L[A[i]-1]=L[A[i]-1]+1
  for i in range(N):
    if L[i]>0:
      print('Yes')
    else:
      print('No')
else:
  for i in range(N):
    print('Yes')
Buggy python submission (verdict: Runtime Error):
A,B=input().split()
import math
print(math.ceil((B-1)/A))


Fixed submission:
A,B=input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))

Buggy python submission (verdict: Runtime Error):
A,B=input().split()
import math
print(math.ceil(B-1)/A)

Fixed submission:
A,B=input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))

Buggy python submission (verdict: Runtime Error):
import math
print(math.ceil((B-1)/A))

Fixed submission:
A,B=input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))

Buggy python submission (verdict: Runtime Error):
import math
math.ceil((B-1)/A)

Fixed submission:
A,B=input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))

Buggy python submission (verdict: Runtime Error):
math.ceil((B-1)/A)

Fixed submission:
A,B=input().split()
import math
print(math.ceil((int(B)-1)/(int(A)-1)))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
d=[int(x) for x in input().split()]
d.sort()
M=max(d)
A=[]
for i in range(M+1):
  A.append(len([j for j in range(N) if d[j]==i]))
count=0
c=0
while(count<N/2):
  count=count+A[c]
  c=c+1
if count!=N/2:
  print(0)
elif count==N/2:
  d=0
  while(count==N/2):
    count=count+A[c]
    c=c+1
    d=d+1
  print(d)

Fixed submission:
N=int(input())
d=[int(x) for x in input().split()]
d.sort()
print(d[int(N/2)]-d[int(N/2)-1])
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
if X==[0,0,0,0,0]:
  print(sum(Y))
else:
  print(time+Y[last])


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
if minimum==100:
  minimum=0
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
if X==[0,0,0,0,0]:
  print(sum(Y))
else:
  print(time+Y[last])

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
print(time+Y[last])


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
if minimum==100:
  minimum=0
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
if X==[0,0,0,0,0]:
  print(sum(Y))
else:
  print(time+Y[last])