Problem:


Score: 200 points

Problem Statement

The restaurant AtCoder serves the following five dishes:

ABC Don (rice bowl): takes A minutes to serve.

ARC Curry: takes B minutes to serve.

AGC Pasta: takes C minutes to serve.

APC Ramen: takes D minutes to serve.

ATC Hanbagu (hamburger patty): takes E minutes to serve.

Here, the time to serve a dish is the time between when an order is placed and when the dish is delivered.

This restaurant has the following rules on orders:

An order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).

Only one dish can be ordered at a time.

No new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.

E869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.

Here, he can order the dishes in any order he likes, and he can place an order already at time 0.

Constraints

A, B, C, D and E are integers between 1 and 123 (inclusive).

Input

Input is given from Standard Input in the following format:

A
B
C
D
E

Output

Print the earliest possible time for the last dish to be delivered, as an integer.

Sample Input 1

29
20
7
35
120

Sample Output 1

215

If we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:

Order ABC Don at time 0, which will be delivered at time 29.

Order ARC Curry at time 30, which will be delivered at time 50.

Order AGC Pasta at time 50, which will be delivered at time 57.

Order ATC Hanbagu at time 60, which will be delivered at time 180.

Order APC Ramen at time 180, which will be delivered at time 215.

There is no way to order the dishes in which the last dish will be delivered earlier than this.

Sample Input 2

101
86
119
108
57

Sample Output 2

481

If we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:

Order AGC Pasta at time 0, which will be delivered at time 119.

Order ARC Curry at time 120, which will be delivered at time 206.

Order ATC Hanbagu at time 210, which will be delivered at time 267.

Order APC Ramen at time 270, which will be delivered at time 378.

Order ABC Don at time 380, which will be delivered at time 481.

There is no way to order the dishes in which the last dish will be delivered earlier than this.

Sample Input 3

123
123
123
123
123

Sample Output 3

643

This is the largest valid case.



Sample input:
29
20
7
35
120


Sample output:
215

Submission status: Wrong Answer

Solution code:
dishes = []
for i in range(5):
    dishes.append(int(input()))
    
ma = 0
fills = []
for dish in dishes:
    fill = 10 - dish % 10
    if fill > ma and fill != 10:
        ma = fill
        max_dish = dish
    
    fills.append(fill)

flag = True
if len(set(fills)) == 1:
    flag = False

if flag:
    sum_dish = 0
    for idx, dish in enumerate(dishes):
        if dish == max_dish:
            sum_dish += dish
        elif dish % 10 == 0:
            sum_dish += dish
        else:
            sum_dish += (dish + fills[idx])
else:
    sum_dish = 0
    for dish in dishes:
        sum_dish += dish
    sum_dish += 4 * fills[0]

print(sum_dish)

Submission status: Wrong Answer

Solution code:
dish = []
for i in range(5):
    dish.append(int(input()))
tmp1 = sum([d // 10 + (d % 10 > 0) for d in dish]) * 10
tmp2 = sum(sorted([d % 10 for d in dish if d % 10 > 0])[:1])
print(tmp1 + tmp2 - 10)

Submission status: Wrong Answer

Solution code:
dish=[int(input()) for i in range(5)]
remain=[(dish[i]-1)%10 for i in range(5)]
divide=[(dish[i]-1)//10+1 for i in range(5)]
a=sorted(remain)[0]
print(a)
print(sum(divide)*10-9+a)
print(sum(divide))

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

l = [A,B,C,D,E]
l = sorted(l)
# print(l)
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = [tl,l]

a = tl.index(min(tl))
# print(l)

for i,v in enumerate(l):
    if i != a:
        temp = v % 10
        temp = 10 - temp + v
        ans = ans + temp
    else:
        ans = ans + v

print(ans)

Submission status: Wrong Answer

Solution code:
dishes = []
for i in range(5):
    dishes.append(int(input()))
    
ma = 0
fills = []
for dish in dishes:
    fill = 10 - dish % 10
    if fill > ma and fill != 10:
        ma = fill
        max_dish = dish
    
    fills.append(fill)

flag = True
if len(set(fills)) == 1:
    flag = False

if flag:
    sum_dish = 0
    for idx, dish in enumerate(dishes):
        if dish == max_dish:
            sum_dish += dish
        elif dish % 10 == 0:
            sum_dish += dish
        else:
            sum_dish += (dish + fills[idx])
else:
    sum_dish = 0
    for dish in dishes:
        sum_dish += dish
    sum_dish += 4 * fills[0]

Submission status: Wrong Answer

Solution code:
#a,b,c = map(int,inpput().split(" "))
#n = int(input())
#print(a,b,c)
t=[]
for i in range(5):
    t.append(int(input()))
#n = int(input())
def dif(x):
    s = int(x/10)
    return (s+1)*10 -x

def comp(a,b):
    a1 = dif(a)
    b1 = dif(b)
    return a1 < b1
d = sorted(t, key=lambda x: dif(x), reverse=True)

sum = 0
for i in range(4):
    if int(d[i]/10)*10 ==d[i]:
        sum = sum+d[i]
    else:
        sum += (int(d[i]/10)+1)*10
print(sum + d[4])

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
an = 0
lis = [a,b,c,d,e]

am = a % 10
bm = b % 10
cm = c % 10
dm = d % 10
em = e % 10

mlis = [am, bm, cm, dm, em]
last = am

for j in range(len(mlis)):
    if mlis[j] == 0:
        an += lis[j]

    else:
        an += lis[j] - mlis[j] + 10
        if mlis[j] < last:
            last = mlis[j]

an = an + last - 10
if last == 0:
    an = an - 10

if a == 0 and b == 0 and c == 0 and d == 0 and e == 0:
    an = 0

print(an)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

res = 0
li = []
li2 = []
for i in range(5):
    li.append(int(input()))
for num in li:
    if num % 10 == 0:
        li2.append(100)
    else:
        li2.append(num % 10)
for j in range(5):
    if min(li2) == li2[j] or li[j] % 10 == 0:
        res += li[j]
    else:
        res += (li[j] // 10 + 1) * 10
print(res)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

# 1のくらいが最も小さいものを最後に注文する

a1 = a%10
b1 = b%10
c1 = c%10
d1 = d%10
e1 = e%10

times = [a,b,c,d,e]
ones = [a1,b1,c1,d1,e1]

# 全て一緒の場合、
#if len(list(set(ones))) == 1:

ones = [10 if i==0 else i for i in ones]

sum = 0

min_index = ones.index(min(ones))
sum += times[min_index]
del times[min_index]
for i in times:
	# 1のくらいは切り上げ: 28
	if i%10==0:
		sum += i
	else:
		sum += (i//10+1)*10
	print(sum)

print(sum)

Submission status: Wrong Answer

Solution code:
time = [input() for _ in range(5)]
ans = []
min_hitoketa = 9
idx = 0

for i, t in enumerate(time):
    if int(t[-1]) < min_hitoketa and int(t[-1]) >= 1:
        min_hitoketa = int(t[-1])
        idx = i
    
    if t[-1] == '0':
        tmp = t
    elif len(t) == 1:
        tmp = '10'
    else:
        tmp = str(int(t[-2]) + 1) + '0'
    
    ans.append(int(tmp))


ans[idx] = int(time[idx])  
#print(ans)
print(sum(ans))

Submission status: Wrong Answer

Solution code:
a = []
b = []

for i in range(5):
    In = int(input())
    a.append(int(In/10))
    b.append(In%10)

b_notzero = [i for i in b if i != 0]
if len(b_notzero) != 0:
    b_notzero.sort()
    b_min = b_notzero[0]
else:
    b_min = 0

print(sum(a) * 10 + (len(b_notzero) - 1) * 10 + b_min)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
Ac=((a//10)+1)*10
Bc=((b//10)+1)*10
Cc=((c//10)+1)*10
Dc=((d//10)+1)*10
Ec=((e//10)+1)*10
Af=(a-1)%10
Bf=(b-1)%10
Cf=(c-1)%10
Df=(d-1)%10
Ef=(e-1)%10

if min(Af,Bf,Cf,Df,Ef)==Af:
  print(a+Bc+Cc+Dc+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Bf:
  print(Ac+b+Cc+Dc+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Cf:
  print(Ac+Bc+c+Dc+Ec)  
  
elif min(Af,Bf,Cf,Df,Ef)==Df:
  print(Ac+Bc+Cc+d+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Ef:
  print(Ac+Bc+Cc+Dc+e)

Submission status: Wrong Answer

Solution code:
ls = []
mod = []
for i in range(5):
    ls.append(int(input()))
    mod.append(ls[i]%10)

def roundup(n):
    if n % 10 < 5:
        return round(n+4,-1)
    else:
        return round(n,-1)


last_index = mod.index(min(mod))
sum = 0
for j in range(5):
    if j == last_index:
        sum += ls[j]
    else:
        sum += roundup(ls[j])
print(sum)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

dish = [a,b,c,d,e]
time = [0,0,0,0,0]
reg = 0
mini = 10

for l in range(5):
  num = dish[l]%10
  print(num)
  if num == 0:
    time[l] = dish[l]
  else:
    time[l] = (dish[l]//10+1)*10
    
  if num != 0 and num < mini:
    mini = num
    reg = l
        
if reg ==0:
  print(a+time[1]+time[2]+time[3]+time[4])
elif reg == 1:
  print(time[0]+b+time[2]+time[3]+time[4])
elif reg == 2:
  print(time[0]+time[1]+c+time[3]+time[4])
elif reg == 3:
  print(time[0]+time[1]+time[2]+d+time[4])
elif reg == 4:
  print(time[0]+time[1]+time[2]+time[3]+e)

Submission status: Wrong Answer

Solution code:
import math
a=int(input());b=int(input());c=int(input());d=int(input());e=int(input())

N=math.ceil(a/10)*10+math.ceil(b/10)*10+math.ceil(c/10)*10+math.ceil(d/10)*10+math.ceil(e/10)*10
X=[a%10,b%10,c%10,d%10,e%10]
if a==b==c==d==e:
  print(N-min(X))
else:
  print(N-(10-min(X)))

Submission status: Wrong Answer

Solution code:
l=[int(input()),int(input()),int(input()),int(input()),int(input())]

n=5
m=10
s=0
while n:
  s += (l[n-1]-1)//10*10+10
  a = l[n-1] % 10
  if a==0 : a =10
  if m>a : m = a
  n -= 1
m %= 10

print(s-10+m)

Submission status: Wrong Answer

Solution code:
a=[0]*5
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
amari=10
for i in range(5):
  if a[i]%10!=0:
    tmp=a[i]%10
  else:
    tmp=10
  amari=min(amari,tmp)
  a[i]=(int(a[i]/10) + 1)*10
print(sum(a)-10+amari)

Submission status: Wrong Answer

Solution code:

list = [int(input()) for i in range(5)]
nList = [round(i+4,-1) for i in list]
print(sum(nList))

Submission status: Wrong Answer

Solution code:
set=[int(input()) for x in range(5)]
set.sort(key=lambda x:abs((x+9)%10),reverse=True)
#print(set)
last=[set.pop(-1)]
set=[int(round(x,-1)) for x in set]
print(sum(set+last))

Submission status: Wrong Answer

Solution code:
inputs = [0,0,0,0,0]
inputs[0] = int(input())

inputs[1] = int(input())

inputs[2] = int(input())

inputs[3] = int(input())

inputs[4] = int(input())


top = 10
top_i = -1

sum = 0

for i in range(5):
	if top > inputs[i] % 10 and inputs[i] % 10 != 0:
		top = inputs[i] % 10
		top_i = i

for i in range(5):
	if i != top_i:
		#print(sum)
		sum = sum + int(inputs[i] / 10) * 10
		if inputs[i] % 10 != 0:
			sum = sum + 10
sum = sum + inputs[top_i]

print(sum)

Submission status: Wrong Answer

Solution code:
import numpy as np

dish_min = []
 
for i in range(5):
   dish_min.append(int(input()))
    
p = [i%10 for i in dish_min]
pp = [(i-1)%10 for i in dish_min]
x = np.argmin(pp)

for i in range(5):
  if i != x and p[i]:
  	dish_min[i] += (10 - p[i])
print(dish_min)
print(sum(dish_min))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

t = [a,b,c,d,e]

min_i = 9
total = 0
for v in t:
  if v%10 < min_i and v%10 > 0:
    min_i = v%10
  if v%10 != 0:
    total += v + 10 - v%10
  else:
    total += v

print(total - 10 + min_i)

Submission status: Wrong Answer

Solution code:
set=[int(input()) for x in range(5)]
set.sort(key=lambda x:abs((x+9)%10),reverse=True)
print(set)
last=[set.pop(-1)]
set=[int(round(x,-1)) for x in set]
print(sum(set+last))

Submission status: Wrong Answer

Solution code:
ryouri = [int(input()) for i in range(5)]

order_1 = [(i-1)*0.1 - int((i-1)*0.1) for i in ryouri]
min_v = sorted(order_1)[0]
min_id = 0
for i, v in enumerate(order_1):
    if v == min_v:
        min_id = i

goukei = 0
for i, (price, order) in enumerate(zip(ryouri, order_1)):
    if i == min_id:
        goukei = goukei + price
    else:
        goukei = goukei + price + 10

print(goukei)

Submission status: Wrong Answer

Solution code:
a=[0]*5
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
amari=10
for i in range(5):
  if a[i]%10!=0:
    tmp=a[i]%10
  else:
    tmp=10
  amari=min(amari,tmp)
  a[i]=(int(a[i]/10) + 1)*10
  print(a)
print(sum(a)-10+amari)

Submission status: Wrong Answer

Solution code:
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
array = [A, B, C, D, E]
min_time= float('inf')

for i in list(itertools.permutations(array)):
    tmp = i[0] + ((10 - i[0]%10) if i[0] % 10 != 0 else 0)
    tmp += i[1] + ((10 - i[1]%10)  if i[1] % 10 != 0 else 0)
    tmp += i[2] + ((10 - i[2]%10) if i[2] % 10 != 0 else 0)
    tmp += i[3] + (10 - i[3]%10)
    tmp += i[4]
    
    min_time = min(min_time, tmp)
    
print(min_time)

Submission status: Wrong Answer

Solution code:
dish=[int(input()) for i in range(5)]
remain=[(dish[i]-1)%10 for i in range(5)]
divide=[(dish[i]-1)//10+1 for i in range(5)]
a=sorted(remain)[4]
print(sum(divide)*10-10+a)

Submission status: Wrong Answer

Solution code:
import math
a=int(input());b=int(input());c=int(input());d=int(input());e=int(input())

N=math.ceil(a/10)*10+math.ceil(b/10)*10+math.ceil(c/10)*10+math.ceil(d/10)*10+math.ceil(e/10)*10
X=[a%10,b%10,c%10,d%10,e%10]
print(N-(10-min(X)))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
an = 0
lis = [a,b,c,d,e]

am = a % 10
bm = b % 10
cm = c % 10
dm = d % 10
em = e % 10

mlis = [am, bm, cm, dm, em]
last = am

for j in range(len(mlis)):
    if mlis[j] == 0:
        an += lis[j]

    else:
        an += lis[j] - mlis[j] + 10
        if mlis[j] < last:
            last = mlis[j]

an = an + last - 10
if last == 0:
    an = an - 10

print(an)

Submission status: Wrong Answer

Solution code:
a = []
for i in range(5):
    a.append(int(input()))

b = []
c = []
for j in range(5):
    if a[j] % 10 == 9:
        b.append(a[j]-9)
        c.append(10)
    elif a[j] % 10 == 0:
        b.append(a[j]-10)
        c.append(10)
    else:
        #10で割った余りを引く
        num = a[j]%10
        c.append(num)
        b.append(a[j] - c[j])

b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10

print(b_sum + c_sum)

Submission status: Wrong Answer

Solution code:
def main():
  A = int(input())
  B = int(input())
  C = int(input())
  D = int(input())
  E = int(input())

  orders = sorted([A,B,C,D,E])
  lunch = {}
  # wattayatu = [10 - (n % 10) for n in orders if n % 10 != 0]
  n10 = []
  for i, n in enumerate(orders):
    if n % 10 == 0:
      n10.append(n)
    else:
      lunch[n] = 10 - (n % 10)
  lunch2 = {}
  for k, v in sorted(lunch.items(), key=lambda x: x[1]):
    lunch2[k] = v


  result = sum(n10)
  for i, (k, v) in enumerate(lunch2.items()):
    if (i+1) == len(lunch2):
      result += k
    else:
      result += k + v
  print(result)


main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
Ac=((a//10)+1)*10
Bc=((b//10)+1)*10
Cc=((c//10)+1)*10
Dc=((d//10)+1)*10
Ec=((e//10)+1)*10
Af=a%10
Bf=b%10
Cf=c%10
Df=d%10
Ef=e%10

if min(Af,Bf,Cf,Df,Ef)==Af:
  print(a+Bc+Cc+Dc+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Bf:
  print(Ac+b+Cc+Dc+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Cf:
  print(Ac+Bc+c+Dc+Ec)  
  
elif min(Af,Bf,Cf,Df,Ef)==Df:
  print(Ac+Bc+Cc+d+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Ef:
  print(Ac+Bc+Cc+Dc+e)

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(5)]
ans=sum(l)
for i in range(len(l)):
    l[i]=l[i]%10
l.sort()
del l[-1]
print(ans+sum(l))

Submission status: Wrong Answer

Solution code:
import numpy as np

i = 0
j = 0

nums = []
first_digits = []
min_first_digit = 9
index = 0
sum = 0

while i < 5:
  x = int(input())
  nums.append(x)
  
  if x % 10 <= min_first_digit and x % 10 != 0:
    min_first_digit = x % 10
    index = i
  i += 1
  
while j < 5:
  if j == index:
    sum += nums[j]
  else:
    sum += (nums[j] + 10 - (nums[j] % 10))
  j += 1
    
print(sum)

Submission status: Wrong Answer

Solution code:
a = []
for i in range(5):
    a.append(int(input() )) 

t =0
for i,m in enumerate(a):
    t += int(m/10) * 10
    if m%10 != 0:
        t = t + 10
    else:
        a.pop(i)

b = [10 - (x%10) for x in a]
print(t - max(b))

Submission status: Wrong Answer

Solution code:
dish = []
for i in range(5):
    dish.append(int(input()))
print(sum([d // 10 + (d % 10 > 0) for d in dish]) * 10 + sorted([d % 10 for d in dish])[0] - 10)

Submission status: Wrong Answer

Solution code:
data = []
for i in range(5):
    data.append(int(input()))
    
estimate_number = data[0]
for i in range(4):
    if estimate_number - data[i+1] -10  > 0:
        estimate_number = data[i]
    else:
        estimate_number = data[i+1]
    
print(estimate_number)

Submission status: Wrong Answer

Solution code:
import math

cook = []
for i in range (5):
    cook.append(int(input()))

times = 0
# mod10が最小のもの(0除く)を最後にすれば最小？
min_10 = []
for c in range(len(cook)):
    min_10.append((cook[c] - 1) % 10)  # 0覗いて最小になるように、cookから1引いたもののmod10を比較

min_index = min_10.index(min(min_10))
print(min_10, min_index)
total_time = 0
for c in range(len(cook)):
    if min_index == c:
        continue
    else:
        total_time += int(math.ceil(cook[c] / 10) * 10)
total_time += cook[min_index]

print(total_time)

Submission status: Wrong Answer

Solution code:
inputs = [0,0,0,0,0]
inputs[0] = int(input())

inputs[1] = int(input())

inputs[2] = int(input())

inputs[3] = int(input())

inputs[4] = int(input())


top = 10
top_i = -1

sum = 0

for i in range(5):
	if top > inputs[i] % 10:
		top = inputs[i] % 10
		top_i = i

for i in range(5):
	if i != top_i:
		#print(sum)
		sum = sum + int(inputs[i] / 10) * 10 + 10
sum = sum + inputs[top_i]

print(sum)

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(5)]
ans=0
for i in range(len(l)):
    ans+=(10-l[i]%10)
print(ans+sum(l))

Submission status: Wrong Answer

Solution code:
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
array = [A, B, C, D, E]
min_time= float('inf')

for i in list(itertools.permutations(array)):
    tmp = i[0] + (10 - i[0]%10)
    tmp += i[1] + (10 - i[1]%10)
    tmp += i[2] + (10 - i[2]%10)
    tmp += i[3] + (10 - i[3]%10)
    tmp += i[4]
    
    min_time = min(min_time, tmp)
    
print(min_time)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
Ac=((a//10)+1)*10
Bc=((b//10)+1)*10
Cc=((c//10)+1)*10
Dc=((d//10)+1)*10
Ec=((e//10)+1)*10
Af=a%10
Bf=b%10
Cf=c%10
Df=d%10
Ef=e%10

if max(Af,Bf,Cf,Df,Ef)==Af:
  print(a+Bc+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Bf:
  print(Ac+b+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Cf:
  print(Ac+Bc+c+Dc+Ec)  
  
elif max(Af,Bf,Cf,Df,Ef)==Df:
  print(Ac+Bc+Cc+d+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Ef:
  print(Ac+Bc+Cc+Dc+e)

Submission status: Wrong Answer

Solution code:
l = [int(input()) for i in range(5)]
l_d = []
for i in l:
  if i % 10 == 0:
    l_d.append(0)
  else:
    n = (i//10+1)*10 - i
    l_d.append(n)
c = []
for i, j in zip(l_d, l):
  c.append([i, j])
  
from operator import itemgetter
c.sort(key=itemgetter(0))
a, b = zip(*c)
d = list(b)
for n, i in enumerate(list(d[:-1])):
  if i % 10 == 0:
    continue
  else:
    d[n] = (i//10+1)*10    
sum(d)

Submission status: Wrong Answer

Solution code:
order = [int(input()) for _ in range(5)]
time = 0
for i in range(len(order)):
  if order[i]%10 == 0:
    time += order[i]
  else:
    time += (order[i]//10+1)*10
print (time)

Submission status: Wrong Answer

Solution code:
A=[int(input()) for _ in range(5)]
A_1=[(i,i%10) for i in A]
A_1.sort(key=lambda x:x[1])
ans=0
count=0
for a,b in A_1:
    if not b==0 and count==0:
        count=b
    if b==0:
        ans+=a
    else:
        ans+=a+abs(10-b)

print(ans-abs(10-count))

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

l = [A,B,C,D,E]
ans = 0
tl = []
for v in l:
    temp = v % 10
    while temp > 10:
        temp = v % 10
    if temp == 0:
        temp = 100
    tl.append(temp)
# print(tl)
tt = [tl,l]

a = tl.index(min(tl))
# print(a)
# print(l)

for i,v in enumerate(l):
    if i != a:
        temp = v % 10
        temp = 10 - temp + v
        ans = ans + temp
    else:
        ans = ans + v

print(ans)

Submission status: Wrong Answer

Solution code:
lis = []
lis2 = []
lis3 = []
mi = 1000000000

for i in range(5):
  a = int(input())
  lis.append(a)
  
for x in lis:
  x2 = x % 10
  if x2 == 0:
    x3 = x
  else:
    x3 = x - x2 + 10
  lis2.append(x2)
  lis3.append(x3)
  
for i in lis2:
  if i != 0:
    if i < mi:
      mi = i

su = sum(lis3)

ans = su + mi - 10

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    h = [int(input()) for count in range(5)]
    total_time = 0
    while len(h) > 0:
        dlist = []
        for i in range(len(h)):
            time = h[i]
            del_time = abs(round(time, -1) - time)
            dlist.append(del_time)
        min_d = dlist.index(min(dlist))
        total_time += h[min_d]
        if len(h) > 1:
            total_time = round(total_time, -1)
        h.pop(min_d)

    print(total_time)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
L = [int(input()) for i in range(5)]
LL = [i % 10 for i in L]
if LL == [0] * 5:
    print(sum(L))
else:
    L2 = LL[:]
    while 0 in L2:
        L2.remove(0)
    ma = min(L2)
    r = LL.index(ma)
    print(ma)
    print(L[r] + sum([L[i] if L[i] % 10 == 0 else L[i] + 10 - L[i] % 10 for i in [j for j in range(5) if j != r]]))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
a1 = 10 - a%10
b1 = 10 - b%10
c1 = 10 - c%10
d1 = 10 - d%10
e1 = 10 - e%10
l = [a1,b1,c1,d1,e1]

for i in range(5):
  if l[i] == 10:
    l[i] = 0
  
def max(x,y):
  if x <= y:
    return y
  else:
    return x
f = max(max(max(max(l[0],l[1]),l[2]),l[3]),l[4])

ans = (a+b+c+d+e) + (a1+b1+c1+d1+e1) - f
print(ans)

Submission status: Wrong Answer

Solution code:
foods = [int(input()) for i in range(5)]
time = 0
rest = list(map(lambda x: x % 10, foods))
for i in range(5):
    if rest[i] == 0:
        time += foods[i]
    else:
        time += foods[i] - rest[i] + 10

if not all(rest):
   print(time)
else:
    print(time - 10 + min([i for i in rest if i != 0]))

Submission status: Wrong Answer

Solution code:
data=[]
for i in range(5):
    data.append(int(input()))

cnt=1000
index=0
for ind,j in enumerate(data):
    if j%10 < cnt and j%10 != 0:
        index=ind
        cnt=j%10
ans=0
for k in data:
    if k % 10 == 0:
        ans += k
    else:
        ans+=(k//10+1)*10
ans=ans+(data[index]%10)-10
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = sorted([a,b,c,d,e], key=lambda x: x%10, reverse=True)

def tyumon(t, ans):
  ans += t
  if ans % 10 == 0:
    return ans
  else:
    return (ans//10 + 1)*10

ans = 0
for i in range(len(l)-1):
  ans = tyumon(l[i], ans)
print(ans + l[-1])

Submission status: Wrong Answer

Solution code:
from operator import itemgetter
import math
a=[i for i in input()]
b=[i for i in input()]
c=[i for i in input()]
d=[i for i in input()]
e=[i for i in input()]
nums = []
nums.append(a)
nums.append(b)
nums.append(c)
nums.append(d)
nums.append(e)
nums.sort(key=itemgetter(-1),reverse = True)
last = 0
for num in nums:
    if num[-1]!="0":
        last= num[-1]
ans = 0
for num in nums:
    ans+=math.ceil(int("".join(num))/10)*10
print(ans-(10-int(last)))

Submission status: Wrong Answer

Solution code:

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


ten = a//10 + b//10 + c//10 + d//10 + e//10

aa = [a%10,b%10,c%10,d%10,e%10]
zero = aa.count(0)

if zero == 5:
	print(ten)
else:
	for i in range(1,10):
		if  i in aa:
			one = i
			break
	print(ten*10 + (4-zero)*10 +one)

Submission status: Wrong Answer

Solution code:
result = 0
A = list()
for i in xrange(5):
    tmp = int(raw_input())
    A.append(tmp)
    result += int(tmp/10) * 10
print result

min = 10
red_count = 0
for i in xrange(5):
    if A[i] % 10 == 0: red_count += 1
    elif min > A[i] % 10:
        min = A[i] % 10

if min == 10: print result
else: print (result+10*(4-red_count)+min)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
Ac=(a//10+1)*10
Bc=(b//10+1)*10
Cc=(c//10+1)*10
Dc=(d//10+1)*10
Ec=(e//10+1)*10
Af=a%10
Bf=b%10
Cf=c%10
Df=d%10
Ef=e%10

if max(Af,Bf,Cf,Df,Ef)==Af:
  print(a+Bc+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Bf:
  print(Ac+b+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Cf:
  print(Ac+Bc+c+Dc+Ec)  
  
elif max(Af,Bf,Cf,Df,Ef)==Df:
  print(Ac+Bc+Cc+d+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Ef:
  print(Ac+Bc+Cc+Dc+e)

Submission status: Wrong Answer

Solution code:
abcde = []
for i in range(5):
    abcde.append(int(input()))

ans = 0
for i, a in enumerate(abcde):
    if a % 10 == 0:
        ans += a
        abcde.pop(i)

b = abcde[0]
for a in abcde:
    if a % 10 < b:
        b = a % 10
    ans -= a % 10
    ans += a + 10
b = 10 - b

ans -= b
print(ans)

Submission status: Wrong Answer

Solution code:
data = []
for i in range(5):
    data.append(int(input()))

for i in range(4):
    if data[i] - data[i+1] -10  > 0:
        estimate_number = data[i]
    else:
        estimate_number = data[i+1]
    
print(estimate_number)

Submission status: Wrong Answer

Solution code:
nums=[int(input()) for i in range(5)]

key=[]
sums=0

for num in nums:
  key.append(num%10)

flag=True

for i in range(len(nums)):
  if nums[i]==nums[key.index(min(key))] and flag:
    flag=False
    continue
  sums+=((10-key[i])+nums[i])
  
print(sums+nums[key.index(min(key))])

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
a1 = 10 - a%10
b1 = 10 - b%10
c1 = 10 - c%10
d1 = 10 - d%10
e1 = 10 - e%10
l = [a1,b1,c1,d1,e1]

for i in range(5):
  if l[i] == 10:
    l[i] = 0
  
def max(x,y):
  if x <= y:
    return y
  else:
    return x
f = max(max(max(max(a1,b1),c1),d1),e1)

ans = (a+b+c+d+e) + (a1+b1+c1+d1+e1) - f
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
array = np.array([a, b, c, d, e])
rlist = [a % 10, b % 10, c % 10, d % 10, e % 10]
minr = min(rlist)
value = 10 - minr
tenList = [int(a / 10) * 10 + 10, int(b / 10) * 10 + 10, int(c / 10) * 10 + 10, int(d / 10) * 10 + 10, int(e / 10) * 10 + 10]
sumv = sum(tenList)
print(int(sumv - value))

Submission status: Wrong Answer

Solution code:
from operator import itemgetter
#N,T = map(int,input().split())
#N=int(input())
import math
a=[i for i in input()]
b=[i for i in input()]
c=[i for i in input()]
d=[i for i in input()]
e=[i for i in input()]
nums = []
nums.append(a)
nums.append(b)
nums.append(c)
nums.append(d)
nums.append(e)
nums.sort(key=itemgetter(-1),reverse = True)
last = 0
for num in nums:
    if num[-1]!="0":
        last= num[-1]
ans = 0
if last!=0:
    for num in nums:
        ans+=math.ceil(int("".join(num))/10)*10
print(ans-(10-int(last)))

Submission status: Wrong Answer

Solution code:
a=[0]*5
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
amari=10
for i in range(5):
  if a[i]%10!=0:
    tmp=a[i]%10
  else:
    tmp=10
  amari=min(amari,tmp)
  a[i]=round(a[i],-1)
print(sum(a)-10+amari)

Submission status: Wrong Answer

Solution code:
d=[int(input()) for i in range(5)]
d2=[j+(10-j%10) for j in d]
d_mod=[10-k%10 for k in d]
ans=sum(d2)-max(d_mod)
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
count = 10
num = 0
num1 = 0


def f(x):
    return x +10 - (x%10)


list1 = [a,b,c,d,e]
for i in range(5):
    if count > list1[i] % 10 and list1[i]%10!=0:
        count = list1[i]%10
        num = i

for j in range(5):
    if j ==num:
        num1 += list1[j]
    else:
        num1 += f(list1[j])
    
print(num1)

Submission status: Wrong Answer

Solution code:
result = 0
A = list()
for i in xrange(5):
    tmp = int(raw_input())
    A.append(tmp)
    result += int(tmp/10) * 10
print result

min = 10
red_count = 0
for i in xrange(5):
    if A[i] % 10 == 0: red_count += 1
    elif min > A[i] % 10:
        min = A[i] % 10

print (result+10*(4-red_count)+min)

Submission status: Wrong Answer

Solution code:
A=[]
Y = []
for i in range(5):
    x = int(input())
    y = x % 10
    A.append((y,x))
    Y.append(y)

sum = 0
f = 0
if Y[0] == Y[1] and Y[1] == Y[2] and Y[2] == Y[3] and Y[3] == Y[4] :
    for i in range(len(A)):
        y,x = A[i]
        A[i] = (x,y)
    f = 1
A = sorted(A)
for i in range(len(A)):
    y,x = A[len(A)-1-i]
    if i == len(A)-1:
        if f == 1:
            sum += y
        else:
            sum += x
    else:
        if f == 1:
            sum += y + (10-x)
        else:
            sum += x + (10-y)

print(sum)

Submission status: Wrong Answer

Solution code:
from math import ceil
ts = [int(input()) for _ in range(5)]
m = 10 - min([t % 10 for t in ts])
tss = [ceil(t / 10) * 10 for t in ts]
print(sum(tss) - m)

Submission status: Wrong Answer

Solution code:
dishes = []
for i in range(5):
    tmp = int(input())
    rank = 10 if tmp % 10 == 0 else tmp % 10
    dishes.append([tmp % 10, tmp])
s_dished = sorted(dishes, reverse=True)

time = 0
for idx,item in enumerate(s_dished):
    time += item[1] + 10 - item[0]

time -= 10 - s_dished[4][0]

print(time)

Submission status: Wrong Answer

Solution code:
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
for i in range(5):
    if lis[i] % 5 != 0:
        plus += 5 - (lis[i] % 5)
print(sum(lis) + plus)

Submission status: Wrong Answer

Solution code:
t = [int(input()) for i in range(5)]
minimum = 10
k = 10
t2 = list()
ans = 0

for i in range(5):
    #    print(-(-t[i] // 10) * 10)
    t2.append(-(-t[i] // 10) * 10)
    if 0 < t[i] % 10 < minimum:
        minimum = t[i] % 10
        k = i

#print(minimum, k)

for i in range(5):
    print(t2[i])
    if i == k:
        ans += t[i]
    else:
        ans += t2[i]


print(ans)