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:
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = list(str(a))
B = list(str(b))
C = list(str(c))
D = list(str(d))
E = list(str(e))

S = []
sum = 0
if A[-1] == "0":
  sum += a
else:
  S.append(A[-1])
  if len(A) == 1:
    sum += 10
  else:
    sum += a + (10 - int(A[-1]))

if B[-1] == "0":
  sum += b
else:
  S.append(B[-1])
  if len(B) == 1:
    sum += 10
  else:
    sum += b + (10 - int(B[-1]))

if C[-1] == "0":
  sum += c
else:
  S.append(C[-1])
  if len(C) == 1:
    sum += 10
  else:
    sum += c + (10 - int(C[-1]))

if D[-1] == "0":
  sum += d
else:
  S.append(D[-1])
  if len(D) == 1:
    sum += 10
  else:
    sum += d + (10 - int(D[-1]))

if E[-1] == "0":
  sum += e
else:
  S.append(E[-1])
  if len(E) == 1:
    sum += 10
  else:
    sum += e + (10 - int(E[-1]))

if len(S) != 0:
  k = np.argmin(S)
  
  sum += int(S[k]) - 10
print(sum)

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]
last=9
for i in range(5):
    if l[i]%10!=0:
        last=min(last,l[i]%10)
        
sum=0
for i in range(5):
    if l[i]%10==0:
        sum+=l[i]
    else:
        sum+=l[i]+10-l[i]%10
print(sum-10+last)

Submission status: Wrong Answer

Solution code:
import numpy as np
l = np.zeros(5)
t = np.zeros(5)
for i in range(5):
    l[i] = int(input())
    t[i] = l[i] - (l[i]//10)*10
t.sort()
l = np.ceil(l/10)*10
ans = int(np.sum(l)+t[0])-10
print(ans)

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(5)]
b = [g%10 for g in a]
kkk = 9
h = 0
for i in range(len(a)):
    g = a[i] % 10
    if g > 0 and g < kkk:
        kkk = g
        h = i
l = a[h]
a.pop(h)
a.append(l)
print(a)
total = 0
for i in a:
    if total % 10 != 0:
        total += 10 - (total % 10)
    total += i

print(total)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def ten(x):
    return 10 - x

lst = []
for i in range(5):
    a = int(stdin.readline().rstrip())
    lst.append(a)

minv = 9
flag = False
for x in lst:
    s = str(x)
    tmp = int(s[-1])
    if tmp < minv and tmp != 0:
        flag = True
        minv = tmp

sum = 0

for x in lst:
    s = str(x)
    tmp = int(s[-1])
    if tmp >= 1:
        tmp2 = ten(tmp)
        sum = sum + x + tmp2
    else:
        sum = sum + x

if minv != 0 and flag:
    sum = sum - (ten(minv))

print(sum)

Submission status: Wrong Answer

Solution code:
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(int(T[i][-1]))
ans = []
for i in range(5):
    if 0 < tmp[i] and tmp[i] <= 5:
        ans.append(i)
if ans == []:
    ans = [0, 1, 2, 3, 4]

lastidx = tmp.index(min([tmp[x] for x in ans]))

sum_ = 0
for i in range(5):
    if tmp[i] == 0:
        sum_ += int(T[i])
    else:
        sum_ += (int(T[i]) + 10 - tmp[i])
print(sum_ - 10 + tmp[lastidx])

Submission status: Wrong Answer

Solution code:
set=[int(input()) for x in range(5)]
set=[x if x>10 else 10 for x in set ]
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:
a=[]
for i in range(5):
    a.append(int(input()))
ans=0
min=10
minn=0
for i in range(5):
    if a[i]%10<=min and a[i]%10!=0:
        min=a[i]%10
        minn=i
for i in range(5):
    if a[i]%10!=0:
        b=(a[i]//10)
        ans=ans+b*10+10
    elif a[i]==0:
        ans+=10
    else:
        ans=ans+a[i]
if a[minn]!=0:
    print(ans-(10-a[minn]%10))
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
a = []
for i in range(5):
    a.append(int(input()))
count = 0
min_i = 9
min_aa = 0
for i in a:
    #しも一桁時刻1~4のもの最小のやつが最後
    ama = i % 10
    if (ama < min_i) & (ama != 0):
        min_i = ama
        min_aa = i
#print('min',min_i)
aaa = 0
for i in a:
    #print(i)
    if ((i == min_aa)&(aaa == 0)):
        count += i
        aaa += 1
    elif (i % 10 == 0):
        #print('tasui',i)
        count += i
    else:
        count += (i + (10 - i % 10))
        #print('tasu',(i + (10 - i % 10)))
print(count)

Submission status: Wrong Answer

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

l1 = [i % 10 for i in li]
min_idx = -1
for i in range(len(l1)):
    if min_idx == -1 or l1[i] != 0 and l1[i] < l1[min_idx]:
        min_idx = i
last = li.pop(min_idx)
print(last)

output = 0
for x in li:
    if x % 10 != 0:
        x = x - (x % 10) + 10
    output += x
print(output + last)

Submission status: Wrong Answer

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

dis_a = 10 - a % 10
dis_b = 10 - b % 10
dis_c = 10 - c % 10
dis_d = 10 - d % 10
dis_e = 10 - e % 10

time = {"a":a, "b":b, "c":c, "d":d, "e":e}
dic = {"a":dis_a, "b":dis_b, "c":dis_c, "d":dis_d, "e":dis_e}

for k,v in dic.items():
	if v == 10 :
		dic[k] = 0

new = {}
for k, v in sorted(dic.items(), key=lambda x: x[1]):
    new[k] = v

ans = 0
for i in range(4):
	ans += time[list(new.keys())[i]] + list(new.values())[i]

ans += time[list(new.keys())[4]]

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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



ans = 0
for i in [a, b, c, d, e]:
    ans += int(math.ceil(i/10)*10)

li = [int(str(a)[-1]), int(str(b)[-1]), int(str(c)[-1]), int(str(d)[-1]), int(str(e)[-1])]
for j in li:
    if j==0:
        li.remove(0)

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

Submission status: Wrong Answer

Solution code:
import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    if m!=0:
        time_list2.append(x+(10-m))
    else:
        time_list2.append(x)
# print("2", time_list2)
# print(round(102,-1))

mod_list = []
for x in time_list:
    m = x % 10
    mod_list.append(10-m)

        
min_ = max(mod_list)
# print(mod_list)



print(sum(time_list2)-min_)

Submission status: Wrong Answer

Solution code:
T = []
for i in range(5):
    T.append(input())
tmp = []
for i in range(5):
    tmp.append(int(T[i][-1]))
ans = []
for i in range(5):
    if 0 < tmp[i] and tmp[i] <= 5:
        ans.append(i)
if ans == []:
    ans.append(0)

lastidx = tmp.index(min([tmp[x] for x in ans]))

sum_ = 0
for i in range(5):
    if tmp[i] == 0:
        sum_ += int(T[i])
    else:
        sum_ += (int(T[i]) + 10 - tmp[i])
print(sum_ - 10 + tmp[lastidx])

Submission status: Wrong Answer

Solution code:
from sys import stdin

def ten(x):
    return 10 - x

lst = []
for i in range(5):
    a = int(stdin.readline().rstrip())
    lst.append(a)
minv = 9
for x in lst:
    s = str(x)
    tmp = int(s[-1])
    if tmp < minv and tmp != 0:
        minv = tmp

sum = 0

for x in lst:
    s = str(x)
    tmp = int(s[-1])
    if tmp >= 1:
        tmp2 = ten(tmp)
        sum = sum + x + tmp2
    else:
        sum = sum + x

if minv != 0:
    sum = sum - (ten(minv))

print(sum)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
import numpy as np
num=[a,b,c,d,e]
resi=[i%10 for i in num]
x=np.argsort(resi)
minnum=num[x[0]]
del(num[x[0]])
sumnum=sum([((i//10)+1)*10 for i in num])
res=sumnum+minnum
print(res)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
a=A%10
b=B%10
c=C%10
d=D%10
e=E%10
if a==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,c,d,e))
elif b==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(a,c,d,e))
elif c==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,a,d,e)) 
elif d==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,a,c,e)) 
elif e==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,a,d,c)) 
else :
    print(A+B+C+D+E+40-a-b-c-d-e+min(b,a,d,e,c))

Submission status: Wrong Answer

Solution code:
a = []
for i in range(5):
    a.append(input())
minn = 9
flag = 1
sumtime = 0
for i in range(5):
	if(minn > a[i]%10 & a[i]%10 > 0):
		minn = a[i]%10
		flag = 0
	if(a[i]%10 == 0):
		sumtime += a[i]
	if(a[i]%10 == 9):
		flag = 0
	else:
		a[i] = a[i] + 10 - a[i]%10
		sumtime += a[i]
if(flag == 1):
	print(sumtime)
else:
	print(sumtime - 10 + minn)

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())

A = list(str(a))
B = list(str(b))
C = list(str(c))
D = list(str(d))
E = list(str(e))

S = []
sum = 0
if A[-1] == "0":
  sum += a
else:
  S.append(A[-1])
  sum += a + (10 - int(A[-1]))

if B[-1] == "0":
  sum += b
else:
  S.append(B[-1])
  sum += b + (10 - int(B[-1]))

if C[-1] == "0":
  sum += c
else:
  S.append(C[-1])
  sum += c + (10 - int(C[-1]))

if D[-1] == "0":
  sum += d
else:
  S.append(D[-1])
  sum += d + (10 - int(D[-1]))

if E[-1] == "0":
  sum += e
else:
  S.append(E[-1])
  sum += e + (10 - int(E[-1]))

if len(S) != 0:
  k = np.argmin(S)
  sum += int(S[k]) - 10
print(sum)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
input = sys.stdin.readline

times = []
for _ in range(5):
    x = int(input())
    times.append([x, ((x + 9) // 10 * 10) - x])

times.sort(key=lambda x : x[1])

ans = 0
for i in range(4):
    ans += times[i][0] + times[i][1]

ans += times[-1][0]

print(times)
print(ans)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
list1=[A,B,C,D,E]
sum=0
for item in list1:
  if(item%10==0):
    sum+=item
  else:
    sum=sum+item+(10-item%10)
list1[0]=list1[0]%10
list1[1]=list1[1]%10
list1[2]=list1[2]%10
list1[3]=list1[3]%10
list1[4]=list1[4]%10
min=min(list1)
sum-=min
print(sum)

Submission status: Wrong Answer

Solution code:
array=[int(input()) for i in range(5)]
n=10
sum=0

for i in range(5): 
    if array[i]%10<n and n!=0: n=array[i]
for i in range(5): sum += int(array[i]/10)+1
if n!=10: print(sum*10-(10-n%10))
else: print(sum*10)

Submission status: Wrong Answer

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

a_s=a/10
a_a=a%10
b_s=b/10
b_a=b%10
c_s=c/10
c_a=c%10
d_s=d/10
d_a=d%10
e_s=e/10
e_a=e%10
A=[]
A.append(a_a)
A.append(b_a)
A.append(c_a)
A.append(d_a)
A.append(e_a)
ans+=(a_s + b_s + c_s + d_s + e_s)*10
A.sort()
for i in range(5):
    if A[i]!=0:
        ans += A[i]
        ans += (5-(i+1))*10
        break

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import numpy

a_t=int(input())
b_t=int(input())
c_t=int(input())
d_t=int(input())
e_t=int(input())

a_d = a_t % 10
b_d = b_t % 10
c_d = c_t % 10
d_d = d_t % 10
e_d = e_t % 10

# dishes = {'a': a_d, 'b': b_d, 'c': c_d, 'd': d_d, 'e': e_d}
dish_d = [a_d, b_d, c_d, d_d, e_d]
d_list = [a_t, b_t, c_t, d_t, e_t]

# min_dish = min(dishes, key=dishes.get)

time = (a_t // 10 + b_t  // 10 + c_t // 10 + d_t // 10 + e_t // 10 + 5) * 10 - (10 - min(dish_d))
print(time)

Submission status: Wrong Answer

Solution code:
dishes=[]
mindiv=10

for i in range(5):
  dishes.append(int(input()))

for j in range(len(dishes)):
  k= dishes[j]
  if(k%10 ==0 ):
    continue
  if(k%10 <mindiv):
    mindiv= k%10
  if(k%10 <5 ):
    k += 5
  dishes[j]= round(k,-1)

print(sum(dishes)-(10-mindiv))

Submission status: Wrong Answer

Solution code:
import math
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
l = [A,B,C,D,E]
l_a = [A%10,B%10,C%10,D%10,E%10]
dif = 9
for j in l_a:
    if j == 0:
        pass
    else:
        if j <= dif:
            dif = j
ans = 0
for i in l:
    if i % 10 == 0:
        ans += i
    else:
        ans += i + (10 - i % 10)
a = ans - (10 - dif)
print(a)

Submission status: Wrong Answer

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

mono = [A,B,C,D,E]
amari = [A%10,B%10,C%10,D%10,E%10]
minamari = min(amari)
jun = []

for i in range(5):
    if amari[i] == 0:
        jun.insert(0,mono[i])
    elif (amari[i] > 0)and(amari[i]==minamari):
        jun.insert(-1,mono[i]//10+10)
    elif (amari[i] > 0)and(amari[i]!=minamari):
        jun.insert(-2,mono[i]//10+10)
        
output = sum(jun)
print(int(output))

Submission status: Wrong Answer

Solution code:
a=[]
for i in range(5):
    a.append(int(input()))
ans=0
min=10
minn=0
for i in range(5):
    if a[i]%10<=min and a[i]%10!=0:
        min=a[i]%10
        minn=i
for i in range(5):
    if a[i]%10!=0:
        b=(a[i]//10)
        ans=ans+b*10+10
    elif a[i]==0:
        ans+=10
    else:
        ans=ans+a[i]
print(ans-(10-a[minn]%10))

Submission status: Wrong Answer

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

B = sorted(A)
sum = 0

for i in range(len(B)):
    y,x = B[i]
    sum += x
    if i == 0:
        sum -= 10-y

print(sum)

Submission status: Wrong Answer

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

num = []
num.append(a%10)
num.append(b%10)
num.append(c%10)
num.append(d%10)
num.append(e%10)

ans = min(num)
x = 10
if min(num) == 0:
  if a%10 != 0 and b%10 != 0 and a%10 > b%10:
    x = b%10
  if b%10 != 0 and c%10 != 0 and x > c%10:
    x = c%10
  if c%10 != 0 and d%10 != 0 and x > d%10:
    x = d%10
  if d%10 != 0 and e%10 != 0 and x > e%10:
    x = e%10
  sum = a+(10-a%10) + b+(10-b%10) + c+(10-c%10) + d+(10-d%10) + e+(10-e%10)-30+x
else:  
  sum = a+(10-a%10) + b+(10-b%10) + c+(10-c%10) + d+(10-d%10) + e+(10-e%10)-10+ans

print(sum)

Submission status: Wrong Answer

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

last = 9
if a % 10 != 0:
  last = a
elif (b % 10 != 0 and last % 10 > b % 10):
  last = b
elif (c % 10 != 0 and last % 10 > c % 10):
  last = c
elif (d % 10 != 0 and last % 10 > d % 10):
  last = d
elif (e % 10 != 0 and last % 10 > e % 10):
  last = e
else:
  last = a
  
print(-(-a // 10) * 10 - (-b // 10) * 10 -(-c // 10) * 10 - (-d // 10) * 10 -(-e // 10) * 10 + last + (-last // 10) * 10)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def ten(x):
    return 10 - x

lst = []
for i in range(5):
    a = int(stdin.readline().rstrip())
    lst.append(a)
minv = 9
for x in lst:
    s = str(x)
    tmp = int(s[-1])
    if tmp < minv:
        minv = tmp

sum = 0

for x in lst:
    s = str(x)
    tmp = int(s[-1])
    if tmp >= 1:
        tmp2 = ten(tmp)
        sum = sum + x + tmp2
    else:
        sum = sum + x

sum = sum - (ten(minv))
print(sum)

Submission status: Wrong Answer

Solution code:
array=[int(input()) for i in range(5)]
n=10
sum=0

for i in range(5): 
    if array[i]%10<n and n!=0: n=array[i]
for i in range(5): sum += int(array[i]/10)+1
print(sum*10-(10-n%10))

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
a=A%10
b=B%10
c=C%10
d=D%10
e=E%10
if a==0 :
    print(A+B+C+D+E+40-a-b-c-d-e+min(b,c,d,e))
elif b==0 :
    print(A+B+C+D+E+40-a-b-c-d-e+min(a,c,d,e))
elif c==0 :
    print(A+B+C+D+E+40-a-b-c-d-e+min(b,a,d,e)) 
elif d==0 :
    print(A+B+C+D+E+40-a-b-c-d-e+min(b,a,c,e)) 
elif e==0 :
    print(A+B+C+D+E+40-a-b-c-d-e+min(b,a,d,c)) 
else :
    print(A+B+C+D+E+40-a-b-c-d-e+min(b,a,d,e,c))

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['{}-{}'.format(n, i)] = 10 - (n % 10)
  # print('lunch: ', lunch)
  lunch2 = {}
  for i, (k, v) in enumerate(sorted(lunch.items(), key=lambda x: x[1])):
    k = k.split('-')[0]
    # print(k, i)
    lunch2['{}-{}'.format(k, i)] = v

  # print('n10: ', n10)
  # print('lunch2: ', lunch2)
  result = sum(n10)
  for i, (k, v) in enumerate(lunch2.items()):
    k = int(k.split('-')[0])
    # print(k)
    if (i+1) == len(lunch2):
      result += k
    else:
      result += k + v
  print(result)


main()

Submission status: Wrong Answer

Solution code:
menu = [int(input()) for i in range(5)]
dist = list(map(lambda x: x%10, menu))
idx = dist.index(min(dist))
dist.pop(idx)
inv = list(map(lambda x: 10-x, dist))
cost = sum(menu) + sum(inv)
print(cost)

Submission status: Wrong Answer

Solution code:
dishes=[]
mindiv=10

for i in range(5):
  dishes.append(int(input()))

for j in range(len(dishes)):
  k= dishes[j]
  if(k%10 ==0 ):
    continue
  if(k%10 <mindiv):
    mindiv= k%10
  if(k%10 <5 ):
    k += 5
  dishes[j]= round(k,-1)
  
print(dishes)
print(mindiv)
print(sum(dishes)-(10-mindiv))

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 am == 0 and bm == 0 and cm == 0 and dm == 0 and em == 0:
    an = an + 10

print(an)

Submission status: Wrong Answer

Solution code:
arr = []
arr.append(input())
arr.append(input())
arr.append(input())
arr.append(input())
arr.append(input())

min = 0

count = 0

num = 0
num_val = 9
for i in range(5):
    if int(arr[i]) >= 100:
        if int(arr[i]) % 100 < num_val and int(arr[i]) % 100 != 0:
            num = i
            num_val = int(arr[i]) % 100

    else:
        if int(arr[i]) % 10 < num_val and int(arr[i]) % 10 != 0:
            num = i
            num_val = int(arr[i]) % 10


list = []

for i in range(5):
    if i != num:
        list.append(arr[i])
list.append(arr[num])


for i in range(5):
    count += int(list[i])
    if i == 4:
        pass
    else:
        if int(list[i]) % 10 == 0:
            pass
        else:
            count += 10 - (int(list[i])%10)

print(count)

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]
value = 0
for i in range(0, 4):
    tmpr = rlist[i] % 10
    if tmpr != 0 and 10 - tmpr > value:
        value = 10 - tmpr
print(value)
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]
for i in range(0, 5):
    tmp = tenList[i]
    if rlist[i]  == 0:
        tenList[i] = tmp - 10
sumv = sum(tenList)
print(int(sumv - value))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a_moji=str(a)
b_moji=str(b)
c_moji=str(c)
d_moji=str(d)
e_moji=str(e)

a1=int(a_moji[-1])
a1_moji=str(a1)
if a1==0:
    a1=10
a_kiriage=a+10-a1

b1=int(b_moji[-1])
b1_moji=str(b1)
if b1==0:
    b1=10
b_kiriage=b+10-b1

c1=int(c_moji[-1])
c1_moji=str(c1)
if c1==0:
    c1=10
c_kiriage=c+10-c1

d1=int(d_moji[-1])
d1_moji=str(d1)
if d1==0:
    d1=10
d_kiriage=d+10-d1

e1=int(e_moji[-1])
e1_moji=str(e1)
if e1==0:
    e1=10
e_kiriage=e+10-e1

k=10
if k>a1:
    k=a1
if k>b1:
    k=b1
if k>c1:
    k=c1
if k>d1:
    k=d1
if k>e1:
    k=e1
print(k)
goke=a_kiriage+b_kiriage+c_kiriage+d_kiriage+e_kiriage+k-10
print(goke)

Submission status: Wrong Answer

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

B = sorted(A)
sum = 0

for i in range(len(B)):
    y,x = B[i]
    sum += x
    if i == len(B)-1:
        sum -= 10-y

print(sum)

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())

A = list(str(a))
B = list(str(b))
C = list(str(c))
D = list(str(d))
E = list(str(e))

S = []
sum = 0
if A[-1] == 0:
  sum += a
else:
  S.append(A[-1])
  sum += a + (10 - int(A[-1]))

if B[-1] == 0:
  sum += b
else:
  S.append(B[-1])
  sum += b + (10 - int(B[-1]))

if C[-1] == 0:
  sum += c
else:
  S.append(C[-1])
  sum += c + (10 - int(C[-1]))

if D[-1] == 0:
  sum += d
else:
  S.append(D[-1])
  sum += d + (10 - int(D[-1]))

if E[-1] == 0:
  sum += e
else:
  S.append(E[-1])
  sum += e + (10 - int(E[-1]))

if len(S) != 0:
  k = np.argmin(S)
  sum += int(S[k]) - 10
print(sum)

Submission status: Wrong Answer

Solution code:
a=[]
for i in range(5):
    a.append(int(input()))
ans=0
min=10
minn=0
for i in range(5):
    if a[i]%10<=min and a[i]%10!=0:
        min=a[i]%10
        minn=i
for i in range(5):
    if a[i]%10!=0:
        b=(a[i]//10)
        ans=ans+b*10+10
    else:
        ans=ans+a[i]
print(ans-(10-a[minn]%10))

Submission status: Wrong Answer

Solution code:
import math

arr = [int(input()) for _ in range(5)]

def orderSort(arr):
    more = 0
    for i in range(4):
        if(arr[i]%10 > arr[i+1]%10):
            arr[i], arr[i+1] = arr[i+1], arr[i]
            more = 1
    return more

while(orderSort(arr)):
    pass

time = 0
for i in range(1, 5):
    time += math.ceil(arr[i]/10) * 10

time += arr[0]

print(time)

Submission status: Wrong Answer

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

B = sorted(A)
sum = 0

for i in range(len(B)):
    y,x = B[i]
    sum += x
    if i == len(B)-1:
        sum -= y

print(sum)

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]
value = 0
for i in range(0, 4):
    tmpr = rlist[i] % 10
    if tmpr != 0 and 10 - tmpr > value:
        value = 10 - tmpr
print(value)
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]
for i in range(0, 5):
    tmp = tenList[i]
    if rlist[i]  == 0:
        tenList[i] = tmp - 10
print(tenList)
sumv = sum(tenList)
print(int(sumv - value))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

order= []
for i in range(5):
    order.append(input())
    
min1 = 9
arg_min1 = 0
for i in range(5):
    #print(order[i][len(order[i])-1],len(order[i]),order[i])
    if int(order[i][-1]) < min1 and int(order[i][-1]) > 0:
        #print(int(order[i][-1]))
        min1 = int(order[i][-1])
        arg_min1= i

print(arg_min1)
for i in range(5):
    order[i]= int(order[i])
        
order_min_sum = 0
for i in range(5):
    if arg_min1 == i:
        order_min_sum += int(order[i])
    else:
        while True:
            if int(order[i]) %10 == 0:
                break
            else:
                #print("are:{}".format(order[i]))
                order[i] = order[i] +1
        order_min_sum += order[i]
    #print("sum,{}".format(order_min_sum))
print(order_min_sum)

Submission status: Wrong Answer

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

num = []
num.append(a%10)
num.append(b%10)
num.append(c%10)
num.append(d%10)
num.append(e%10)

ans = min(num)
x = 10
if num == 0:
  if a%10 != 0 and b%10 != 0 and a%10 > b%10:
    x = b%10
  if b%10 != 0 and c%10 != 0 and x > c%10:
    x = c%10
  if c%10 != 0 and d%10 != 0 and x > d%10:
    x = d%10
  if d%10 != 0 and e%10 != 0 and x > e%10:
    x = e%10
  sum = a+(10-a%10) + b+(10-b%10) + c+(10-c%10) + d+(10-d%10) + e+(10-e%10)-10+x
else:  
  sum = a+(10-a%10) + b+(10-b%10) + c+(10-c%10) + d+(10-d%10) + e+(10-e%10)-10+ans

print(sum)

Submission status: Wrong Answer

Solution code:
a=[int(input()) for i in range(5)]
b=[a[i]//10*10 for i in range(5)]
c=min([a[i]%10 for i in range(5)])
print(c+40+sum(b))

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 == 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)
if c_min ==10:
    c_sum = 4 * 10
else:
    c_sum = c_min + 4*10

print(b_sum + c_sum)

Submission status: Wrong Answer

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

min_value=10
min_index=0
for i, data in enumerate(input_data):
    if data%10 < min_value:
        min_value = data%10
        min_index = i

sum_value=0
for i, data in enumerate(input_data):
    if i != min_index:
        if data%10 != 0:
            sum_value += (int(data/10)+1) *10
        else:
            sum_value += data
    else:
        sum_value += data
print(sum_value)

Submission status: Wrong Answer

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

B = sorted(A)
sum = 0

for i in range(len(B)):
    x,y = B[i]
    sum += x
    if i == len(B)-1:
        sum -= y

print(sum)

Submission status: Wrong Answer

Solution code:
a=[int(input()) for i in range(5)]
b=[0]*5
for i in range(5):
  b[i]=(a[i]%10)
c=min(b)
c=b.index(c)
count=0
for i in range(5):
  if i!=c:
    count=count+(a[i]//10)
    if a[i]/10!=0:
      count=count+1
count=count*10+a[c]
print(count)

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 = 999
min_id = 0
for i, v in enumerate(order_1):
    if v < min_v:
        min_v = 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 + round(price*0.1)*10

print(goukei)

Submission status: Wrong Answer

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

list = []
list.append(a)
list.append(b)
list.append(c)
list.append(d)
list.append(e)

for i in range(5):
    for j in range(i,5):
        if int(list[i])%10 != 0 and int(list[i])%10<int(list[j])%10:
            temp = list[i]
            list[i] = list[j]
            list[j] = temp
        
s = 0
for i in range(3):
    if int(list[i])%10 != 0:
        s += int(list[i])-int(list[i])%10+10
    else:
        s += int(list[i])

s += int(list[4])

print(s)

Submission status: Wrong Answer

Solution code:
import math
n = [int(input()) for i in range(5)]
temp = 9
answer = 0
for i in n:
  last_dig = i % 10
  if last_dig < temp:
    temp = last_dig
  answer += math.ceil(i/10)*10
print(answer - 10 + temp)

Submission status: Wrong Answer

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

ans = 0
c = 0

# 先にdivmod(data[c], 10)[1] == 0 をansに追加しちゃう
for zero_c in range(len(data)):
  if divmod(data[zero_c], 10)[1] == 0:
    ans += data[zero_c]
    data[zero_c] = 0

# print("ans:", ans)
# print("data:", data)

while data != [0, 0, 0, 0, 0]:
  if data.count(0) == 4:
    ans += data[c]
    data[c] = 0
    c += 1
  else:
    for i in range(9, 0, -1):
      if divmod(data[c], 10)[1] == i:
        ans += data[c] + (10 - i)
        data[c] = 0
    c += 1

# print("ans:", ans)
# print("data:", data)
print(ans)

Submission status: Wrong Answer

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

dis_a = 10 - a % 10
dis_b = 10 - b % 10
dis_c = 10 - c % 10
dis_d = 10 - d % 10
dis_e = 10 - e % 10

time = {"a":a, "b":b, "c":c, "d":d, "e":e}

dic = {"a":dis_a, "b":dis_b, "c":dis_c, "d":dis_d, "e":dis_e}

for k,v in dic.items():
	if v == 10 :
		dic[k] = 0


new = {}
for k, v in sorted(dic.items(), key=lambda x: x[1]):
    new[k] = v

ans = 0
for i in range(4):
	ans += time[list(new.keys())[i]] + list(new.values())[i]

ans += time[list(new.keys())[4]]

print(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]
    print(sum(a) * 10 + (len(b_notzero) - 1) * 10 + b_min)
else:
    b_min = 0
    print(sum(a))

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
a=A%10
b=B%10
c=C%10
d=D%10
e=E%10
print(A+B+C+D+E+40-a-b-c-d-e+min(a,b,c,d,e))