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:
l = [int(input()) for i in range(5)]
min = l[0] % 10
min_index = 0
sum = 0
for i in range(1, len(l)):
    if l[i] % 10 != 0 and l[i] % 10 < min:
        min = l[i]
        min_index = i
for i in range(len(l)):
    if i != min_index:
        sum += (l[i] + 9) // 10
sum *= 10
sum += l[min_index]
print(sum)

Submission status: Wrong Answer

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

LL = {}

for i in range(len(L)):
	I = str((L[i]-1))[-1]
	I = int(I)
	LL[i] = I

key = [k for k,v in LL.items() if v == min(LL.values())][0]

min = L[key]
L[key] = 0

for i in range(0,5):
	digit_one = str(L[i])[-1]
	if digit_one != "0":
		L[i] += 10 - int(digit_one)
	
print(sum(L) + min)

Submission status: Wrong Answer

Solution code:

x = [input() for _ in range(5)]
ans = []
for i in range(5):
    if x[i][-1] == "0":
        ans.append(int(x[i]))
for j in range(9,0,-1):
    for i in range(5):
        if int(x[i][-1]) == j:
            if len(ans) != 4:
                for k in range(1,9):
                    if (int(x[i]) + k )% 10 == 0:
                        ans.append(int(x[i]) + k)
            else:
                ans.append(int(x[i]))

print(sum(ans))

Submission status: Wrong Answer

Solution code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

if(time_residual_notZero == []):time_residual_notZero=[0]
ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
print(ans)

Submission status: Wrong Answer

Solution code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

#ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
#print(ans)

Submission status: Wrong Answer

Solution code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

#time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

#ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
#print(ans)

Submission status: Wrong Answer

Solution code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

#time_residual = [i%10 for i in time]
# print(time_residual)

#time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

#ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
#print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

l = 9
ans = 0
for _ in range(5):
    num = ni()
    ans += -(-num//10) * 10
    if num % 10 != 0 and l > num % 10:
        l = num % 10
    elif num % 10 == 0:
        l = 10
if l != 0:
    ans += - 10 + l
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

l = 9
ans = 0
for _ in range(5):
    num = ni()
    ans += -(-num//10) * 10
    if num % 10 != 0 and l > num % 10:
        l = num % 10
ans += - 10 + l
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

l = 9
ans = 0
for _ in range(5):
    num = ni()
    ans += -(-num//10) * 10
    if num % 10 != 0 and l > num % 10:
        l = num % 10
ans += - 10 + l
print(l)
print(ans)

Submission status: Wrong Answer

Solution code:
lis = [int(input()) for _ in range(5)]
lis1 = [lis[i]%10 for i in range(5)]
lis10 = [lis[i]//10 for i in range(5)]
ans = 0
for i in range(5):
    if lis1[i]:
        ans += 10
    if not lis1[i]:
        lis1[i] = 10
minlis1 = min(lis1)
if minlis1 == 10:
    minlis1 = 0
ans += sum(lis10)*10
ans += minlis1-10

print(ans)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for _ in [0]*5]
B = [-(-a//10)*10 - a for a in A]
print(B)
print(sum(B) + sum(A) - max(B))

Submission status: Wrong Answer

Solution code:
import math
L = [int(input()) for _ in range(5)]
Lm = []
for i in range(len(L)):
    if i%10 == 0:
        Lm.append(0)
    else:
        Lm.append(10-i%10)
print(sum([10*math.ceil(i/10) for i in L])-max(Lm))

Submission status: Wrong Answer

Solution code:
li = []
for i in range(5):
    li.append(int(input()))
li2 = [x%10 for x in li]
li3,li4 = [],[]
for i,j in zip(li,li2):
    li3.append([i,j])
li3.sort( key = lambda x:x[1])
import math
for i in range(len(li3)):
    if i == 0:
        li4.append(li3[i][0])
    else:
        li4.append(math.ceil(li3[i][0]/10)*10)
print(sum(li4))

Submission status: Wrong Answer

Solution code:
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)
    else:
        first_digit.append(0.001)

# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10

print(int(t - (10 - min(first_digit))))

Submission status: Wrong Answer

Solution code:
m=[int(input()) for i in range(5)]
k = []
j=[]
for i in range(5):
    j.append(-(-m[i]//10)*10)
    k.append(m[i] - (m[i]//10)*10)
if min(k) == 0:
    print(sum(j))
else:
    print(sum(j)-(10-min(k)))

Submission status: Wrong Answer

Solution code:
m=[int(input()) for i in range(5)]
k = [9999] * 5
j=[]
for i in range(5):
    j.append(-(-m[i]//10)*10)
    t = m[i] - (m[i]//10)*10
    if t>0:
      k.append(t)
if min(k) == 0:
    print(sum(j))
else:
    print(sum(j)-(10-min(k)))

Submission status: Wrong Answer

Solution code:
m=[int(input()) for i in range(5)]
k = [99990] * 5
j=[]
for i in range(5):
    j.append(-(-m[i]//10)*10)
    t = m[i] - (m[i]//10)*10
    if t>0:
      k.append(t)
    
print(sum(j)-(10-min(k)))

Submission status: Wrong Answer

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

sa = a % 10
if sa == 0:
    sa = 10
sb = b % 10
if sb == 0:
    sb = 10
sc = c % 10
if sc == 0:
    sc = 10
sd = d % 10
if sd == 0:
    sd = 10
se = e % 10
if se == 0:
    se = 10


amari = min(sa,sb,sc,sd,se)


a = round(a,-1)
b = round(b,-1)
c = round(c,-1)
d = round(d,-1)
e = round(e,-1)


if amari == 0:
    print(a+b+c+d+e)
else:
    print(a+b+c+d+e-10+amari)

Submission status: Wrong Answer

Solution code:
import math
ans = 0
min_mod = 10
for i in range(5):
  a = int(input())
  ans += math.ceil(a/10)*10
  if a % 10 != 0:
    min_mod = min(min_mod, a % 10)
  
print(ans-min_mod+10)

Submission status: Wrong Answer

Solution code:
import math
ans = 0
min_mod = 10
for i in range(5):
  a = int(input())
  ans += math.ceil(a/10)*10
  if a % 10 != 0:
    min_mod = min(min_mod, a % 10)
  
print(ans+min_mod%10)

Submission status: Wrong Answer

Solution code:
import math
ans = 0
min_mod = 10
for i in range(5):
  a = int(input())
  ans += math.ceil(a/10)*10
  if a % 10 != 0:
    min_mod = min(min_mod, a % 10)
  
print(ans+min_mod)

Submission status: Wrong Answer

Solution code:
a = list(int(input()) for _ in range(5))
s = sum(a)
for i in a:
    if i % 10 == 0:
        a.remove(i)
a_ = list(10-(j % 10) for j in a)
a_.sort()
a_.pop(-1)
print(s + sum(a_))

Submission status: Wrong Answer

Solution code:
l = [int(input()) for _ in range(5)]
ans = 0
for j in range(5):
    if 0 < l[j] % 10:
        ans += (l[j] // 10 + 1) * 10
    else:
        ans += l[j]
print(ans)

Submission status: Wrong Answer

Solution code:
import math
src = [input() for _ in range(5)]
k_li = []
v_li = []
for s in src:
    k_li.append(int(s[-1]))
    v_li.append(int(s))
m = min(k_li)
flag = False
sum = 0
for k,v in zip(k_li,v_li):
    if k == m and flag == False:
        sum += v
        flag = True
    else:
        sum += math.ceil(v/10)*10
print(sum)

Submission status: Wrong Answer

Solution code:
dish_list = [int(input()) for _ in range(5)]
last_num_list = [int(str(dish_i)[-1]) for dish_i in dish_list]
last_num_min_index = last_num_list.index(min(last_num_list))

ceiling_dish_list = [-10* (-i//10) for i in dish_list]

print(sum(ceiling_dish_list) - ceiling_dish_list[last_num_min_index] + dish_list[last_num_min_index])

Submission status: Wrong Answer

Solution code:
import math 

dish_list = [int(input()) for _ in range(5)]
last_num_list = [int(str(dish_i)[-1]) for dish_i in dish_list]
last_num_min_index = last_num_list.index(min(last_num_list))

ceiling_dish_list = [10* math.ceil(i/10) for i in dish_list]

print(sum(ceiling_dish_list) - ceiling_dish_list[last_num_min_index] + dish_list[last_num_min_index])

Submission status: Wrong Answer

Solution code:
A = []
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.sort(key=lambda x: x // 10)
ans = A[0] + A[1] // 10 * 10 + A[2] // 10 * 10 + A[3] // 10 * 10  + A[4] // 10 * 10 + 40
print(ans)

Submission status: Wrong Answer

Solution code:
time = []
for i in range(5):
  time.append(int(input()))
  
time_diff = [10-(i%10) for i in time]
time_ten = [i+10-i%10 for i in time]

max_diff = time_diff.index(max(time_diff))

ans = sum(time_ten) - time_ten[max_diff] + time[max_diff]

print(ans)

Submission status: Wrong Answer

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

saigo = 9
for i in range(5):
    if t[i] % 10 != 0:
        saigo = min(saigo,t[i]%10)

jikan = 0
for i in range(5):
    if t[i] % 10 == 0:
        jikan += t[i]
    else:
        jikan += t[i] + 10 - t[i]%10

jikan -= 10 - saigo
print(jikan)

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(5)]
b = [10-(j % 10) for j in a]
for k in b:
    if k == 10:
        b.remove(k)
b.sort()
b.remove(b[-1])
print(sum(a)+sum(b))

Submission status: Wrong Answer

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

m = 123
sum = 0

for i in range (0,5):
  sum += (a[i]//10)*10
  if a[i]%10 != 0:
    sum += 10
    m = min(m,a[i]%10)
if min != 123:
  print(sum+m-10)
else:
  print(sum)

Submission status: Wrong Answer

Solution code:
A,B,C,D,E=(int(input()) for _ in range(5))
X=[A,B,C,D,E]
time=0
rest=[]
for i in range(5):
    if X[i]%10!=0:
        time+=(X[i]//10+1)*10
    else:
        time+=X[i]
    rest.append(X[i]%10)
if min(rest)==0:
    print(time)
else:
    time+=min(rest)-10
    print(time)

Submission status: Wrong Answer

Solution code:
A,B,C,D,E=(int(input()) for _ in range(5))
X=[A,B,C,D,E]
time=0
rest=[]
for i in range(5):
    time+=(X[i]//10+1)*10
    rest.append(X[i]%10)
time=time+min(rest)-10
print(time)

Submission status: Wrong Answer

Solution code:
A,B,C,D,E=(int(input()) for _ in range(5))
X=[A,B,C,D,E]
time=0
rest=[]
for i in range(5):
    time+=(X[i]//10+1)*10
    rest.append(X[i]%10)
time+=min(rest)
print(time)

Submission status: Wrong Answer

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a=[int(input()) for _ in [0]*5]
c=9
for i in range(5):
	if int(str(a[i])[-1])==0:
		continue
	c=min(int(str(a[i])[-1]),c)
	
for i in range(5):
	a[i]=(-(-(a[i])//10))*10

if c==0:
	print(sum(a))
else:
	print(sum(a)-(10-c))

Submission status: Wrong Answer

Solution code:
A = input()
a = int(A[-1])
B = input()
b = int(B[-1])
C = input()
c = int(C[-1])
D = input()
d = int(D[-1])
E = input()
e = int(E[-1])
an = [A,B,C,D,E]
mi = [a,b,c,d,e]
mie = min(mi)
ans = 0
for i in range(5):
  if mi[i]!=mie:
    ans += int(an[i])+10-mi[i]
  else:
    ans += int(an[i])
print(ans)

Submission status: Wrong Answer

Solution code:
a=list(int(input()) for i in range(5))

b=[-(-a[i]//10)*10 for i in range(5)]
c=[a[i]%10 for i in range(5) if a[i]%10 != 0]

if c != []:
    print(sum(b) + min(c) -10)
else:
    print(sum(b) -10)

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())
last = -1
mini = 9
for i in range(5):
  if mini > A[i] % 10 and A[i]%10 != 0:
    mini = A[i] % 10
    last = i
count = 0
for i in range(5):
  if i != last:
    count += (((A[i]-1) // 10) * 10)+10
  else:
    count += A[i]
print(count)

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())
last = -1
mini = 9
for i in range(5):
  if mini > A[i] % 10 and A[i]%10 != 0:
    mini = A[i] % 10
    last = i
count = 0
for i in range(5):
  if i != last:
    count += (((A[i]-1) // 10) * 10)+10

print(count + A[last])

Submission status: Wrong Answer

Solution code:
import math

times = [0]*5
for i in range(5):
    times[i] = int(input())

#1桁目が一番小さいものを判断する
mini = 9
idx = 9
for time in times:
    if time%10 < mini and time%10 > 0:
        mini = min(mini,time%10)
        idx = times.index(time)

total = 0
for i in range(5):
    if i == idx:
        total += times[i]
    else:
        total += math.ceil(times[i]/10)*10
print(total)

Submission status: Wrong Answer

Solution code:
r=[int(input()) for _ in range(5)]
#print(r)

ans=0
rowMin=-9

for item in r:
  ans+=(((-1*item)//10)*(-10))
  if item%10 !=0 and item%10<rowMin%10:
    rowMin=item
    
if rowMin>0:
  ans=ans+rowMin-(((-1*rowMin)//10)*(-10))
else:
  ans=ans
print(ans)

Submission status: Wrong Answer

Solution code:
r=[int(input()) for _ in range(5)]
#print(r)

ans=0
rowMin=0

for item in r:
  ans+=(((-1*item)//10)*(-10))
  if item%10 !=0 and item%10<rowMin%10:
    rowMin=item
    

ans=ans+rowMin-(((-1*rowMin)//10)*(-10))
print(ans)

Submission status: Wrong Answer

Solution code:
r=[int(input()) for _ in range(5)]
#print(r)

ans=0
rowMin=9

for item in r:
  ans+=(((-1*item)//10)*(-10))
  if item%10 !=0 and item%10<rowMin%10:
    rowMin=item
    

ans=ans+rowMin-(((-1*rowMin)//10)*(-10))
print(ans)

Submission status: Wrong Answer

Solution code:
import math
l = [int(input()) for _ in range(5)]

sorted(l, key= lambda x: (x-1)%10, reverse = True)
ans = 0

for i in range(4):
  ans += math.ceil(l[i] / 10) * 10
ans += l[-1]

print(ans)

Submission status: Wrong Answer

Solution code:
import math
T = [int(input()) for i in range(5)]
print(T)
Rest=[0]*5
for i in range(5):
    if T[i]%10 == 0:
        Rest[i] = 10
    else: Rest[i] = T[i]%10
maxrest = 10-min(Rest)
ans = 0
for i in range(5):
    ans += 10*math.ceil(T[i]/10)
print(ans-maxrest)

Submission status: Wrong Answer

Solution code:
a = [ int(input()) for _ in range(5)]
n = float("inf")
for i in range(5):
    if 0 < a[i] % 2 < 10:
        n = min(n,a[i] % 10)
else:
    if n == float("inf"):
        n = 0
print(sum([(-a[i]//10)*-10 for i in range(5)]) -(10-n))

Submission status: Wrong Answer

Solution code:
a = [ int(input()) for _ in range(5)]
n = float("inf")
for i in range(5):
    if 0 < a[i] % 2 < 10:
        n = min(n,a[i] % 10)
        print(n)
else:
    if n == float("inf"):
        n = 0
print(sum([(-a[i]//10)*-10 for i in range(5)]) -(10-n))

Submission status: Wrong Answer

Solution code:
import math
a,b,c,d,e = map(int, open(0).read().split())
an = -(-a//10)*10
bn = -(-b//10)*10
cn = -(-c//10)*10
dn = -(-d//10)*10
en = -(-e//10)*10
total = math.ceil(an+bn+cn+dn+en)
tt=[]
ap = a%10
bp = b%10
cp = c%10
dp = d%10
ep = e%10
ff = [ap,bp,cp,dp,ep]
for i in ff:
  if i !=0:
    tt.append(i) 
    goal=total-10+min(tt)
  else:
    goal=total
print(goal)

Submission status: Wrong Answer

Solution code:
import math
a,b,c,d,e = map(int, open(0).read().split())
an = -(-a//10)*10
bn = -(-b//10)*10
cn = -(-c//10)*10
dn = -(-d//10)*10
en = -(-e//10)*10
total = math.ceil(an+bn+cn+dn+en)
tt=[]
ap = a%10
bp = b%10
cp = c%10
dp = d%10
ep = e%10
ff = [ap,bp,cp,dp,ep]
for i in ff:
  if i !=0:
    tt.append(i) 
    goal=total-10+min(tt)
  else:
    goal=total-10
print(goal)

Submission status: Wrong Answer

Solution code:
import math
a,b,c,d,e = map(int, open(0).read().split())
an = -(-a//10)*10
bn = -(-b//10)*10
cn = -(-c//10)*10
dn = -(-d//10)*10
en = -(-e//10)*10
total = math.ceil(an+bn+cn+dn+en)
tt=[]
ap = a%10
bp = b%10
cp = c%10
dp = d%10
ep = e%10
ff = [ap,bp,cp,dp,ep]
for i in ff:
  if i !=0:
    tt.append(i) 
  else:
    tt.append(0)
print(total-10+min(tt))

Submission status: Wrong Answer

Solution code:
import math

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

A=B=C=D=E=11

if a%10!=0:
  A=a%10
if b%10!=0:
  B=b%10
if c%10!=0:
  C=c%10
if d%10!=0:
  D=d%10
if e%10!=0:
  E=e%10

k=min(A,B,C,D,E)
if A==B==C==D==E==0:
  k=10
sum=(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)

print(sum-10+k)

Submission status: Wrong Answer

Solution code:
import math

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

A=B=C=D=E=11

if a%10!=0:
  A=a%10
if b%10!=0:
  B=b%10
if c%10!=0:
  C=c%10
if d%10!=0:
  D=d%10
if e%10!=0:
  E=e%10

k=min(A,B,C,D,E)

a=math.ceil(a/10)*10
b=math.ceil(b/10)*10
c=math.ceil(c/10)*10
d=math.ceil(d/10)*10
e=math.ceil(e/10)*10

print(a+b+c+d+e-10+k)

Submission status: Wrong Answer

Solution code:
menu = [ int(input()) for i in range(5)]
menu_per = [j % 10 for j in menu]
ans = 0
for _ in range(len(menu)):
  index = menu_per.index(max(menu_per))
  if ans % 10 == 0:
    ans += menu[index]
  else:
    tmp = int(ans % 10)
    ans += (10 - tmp)
    ans += menu[index]
  menu_per.pop(index)
  menu.pop(index)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
total = 0
first_min = 9
for _ in range(5):
    time = int(input())
    total += math.ceil(time/10)*10
    if first_min > time%10 > 0:
        first_min = time%10
print(total-10+first_min)

Submission status: Wrong Answer

Solution code:
inputs=[int(input()) for _ in range(5)]
inputs.sort()

ans=0
ans=1000000000000000
for i in range(len(inputs)):
  tmp=0
  for j in range(len(inputs)):
    no=(i+j)%len(inputs)
    if j!=len(inputs)-1:
      tmp+=inputs[no]+(10-inputs[no]%10)
    else:
      tmp+=inputs[no]
  if ans>tmp:
    ans=tmp
print(ans)

Submission status: Wrong Answer

Solution code:
inputs=[int(input()) for _ in range(5)]
inputs.sort()

ans=0
for inp in inputs[:]:
  if inp%10==0:
    ans+=inp
    inputs.remove(inp)

add=1000000000000000
for i in range(len(inputs)):
  tmp=0
  for j in range(len(inputs)):
    no=(i+j)%len(inputs)
    if j!=len(inputs)-1:
      tmp+=inputs[no]+(10-inputs[no]%10)
    else:
      tmp+=inputs[no]
  if add>tmp:
    add=tmp
print(ans+add)

Submission status: Wrong Answer

Solution code:
minv = 9
time = 0
for i in range(5):
    p = int(input())
    if p%10 >0:
        minv = min(minv,p%10)
        q = (p//10)*10+10
        time += q
    else:
        time+= p
time -=10-minv
print(time)

Submission status: Wrong Answer

Solution code:
list = list(int(input()) for _ in range(5))
ans = 0
tag = 9
for i in range(5):
  if list[i]%10==0:
    ans+=list[i]
  else:
    ans+=list[i]+(10-(list[i]%10))
    if tag>list[i]%10:
      tag = list[i]%10
print(ans-(10-tag))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a1=a%10
b1=b%10
c1=c%10
d1=d%10
e1=e%10
ar=[a1,b1,c1,d1,e1]
a2=a//10
b2=b//10
c2=c//10
d2=d//10
e2=e//10
k=10
s=0
minimini=0
for i in ar:
    if i==0:
        continue
    minimini=min(i,k)
    if i<k:
        k=i
        continue
    else:
        s+=10
print((a2+b2+c2+d2+e2)*10+minimini+s)

Submission status: Wrong Answer

Solution code:
c=list(int(input()) for i in range(5))
amari=0
ma=0
for i in range(5):
    if c[i]%10!=0:
        amari+=10-(c[i]%10)
        if c[i]%10>ma:
            ma=10-(c[i]%10)           
time=sum(c)+(int(amari-ma))
print(int(time))

Submission status: Wrong Answer

Solution code:
c=list(int(input()) for i in range(5))
amari=0
ma=0
for i in range(5):
    if c[i]%10!=0:
        amari+=10-(c[i]%10)
        if c[i]%10>ma:
            ma=10-(c[i]%10)           
time=sum(c)+(amari-ma)
print(time)

Submission status: Wrong Answer

Solution code:
t = [int(input()) for i in range(5)]
r = [0] * 5
q = 0

for i in range(5):
    tr = t[i] % 10
    tq = t[i] // 10
    if tr == 0:
        r[i] = 10
        q += tq
    else:
        r[i] = tr
        q += tq + 1

if min(r) != 10:
    q -= 1

print(q * 10 + min(r))

Submission status: Wrong Answer

Solution code:
input_li = [int(input()) for _ in range(5)]
rest_li = [_ % 10 for _ in input_li]

min_li = min(rest_li)
del rest_li[rest_li.index(min_li)]
total = 0

for i in  rest_li:
    if i != 0:
        total += 10 - i

print(sum(input_li) + total)

Submission status: Wrong Answer

Solution code:
r=0
m=9
for i in range(5):
    t=int(input())
    h=int(str(t)[-1])
    if h==0:
        r+=t
    else:
        t=(t+10-1)//10*10
        r+=t
        m=min(m,h)
print(r-10+m)

Submission status: Wrong Answer

Solution code:
l = [int(input()) for i in range(5)]
ll = []
ans = -10
for i in range(5):
    if l[i] % 10 ==0:
        ans += l[i]
    else:
        ll.append(l[i]%10)
        ans += (l[i]//10 + 1)*10
if ll == []:
    pass
else:
    ans += min(ll)
print(ans)

Submission status: Wrong Answer

Solution code:
myArray = list()
for n in range(5):
    myArray.append(int(input()))
Jouyo  = 9

for i,j in enumerate(myArray):
    if 0 < j % 10 <= Jouyo:
        Jouyo = j % 10
        jouyoi = i
jouyoi = 0
times = 0
for i,j in enumerate(myArray):
    if i != jouyoi:
        if j % 10 != 0:
            times += ((j // 10) + 1) * 10
        else:
            times += j
    else:
        times += j
print(times)

Submission status: Wrong Answer

Solution code:
li=[input() for i in range(5)]
mi=9
for i in range(5):
    if int(li[i][-1])!=0:
        mi = min(mi, int(li[i][-1]))
ans = 0

for i in range(5):
    if int(li[i])%10 !=0:
        ans += int(li[i])+(10-int(li[i])%10)
    else:
        ans += int(li[i])
print(ans-10+mi)

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

ins = np.zeros(5)
ins[0] = a
ins[1] = b
ins[2] = c
ins[3] = d
ins[4] = e

ls = np.zeros(5)
ls[0] = a%10
ls[1] = b%10
ls[2] = c%10
ls[3] = d%10
ls[4] = e%10
x = np.argsort(ls)

ans = 0
for i in range(5):
    if ls[i]==0:
        ans = ans+ins[i]
    elif i==x[0]:
        ans = ans+ins[i]
    else:
        ans = ans + ((ins[i]//10)+1)*10
print(int(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())

ins = np.zeros(5)
ins[0] = a
ins[1] = b
ins[2] = c
ins[3] = d
ins[4] = e

ls = np.zeros(5)
ls[0] = a%10
ls[1] = b%10
ls[2] = c%10
ls[3] = d%10
ls[4] = e%10
x = np.argsort(ls)

ans = 0
for i in range(5):
    if ls[i]==0:
        ans = ans+ins[i]
    elif i==x[0]:
        ans = ans+ins[i]
    else:
        ans = ans + ((ins[i]//10)+1)*10
print(ans)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
mod = 10
_sum = 0
flag = False
for a in (A,B, C, D, E):
    if a % 10 == 0:
        _sum += a
    else:
        flag = True
        _sum += (a + 10) - (a % 10)
        if a % 10 < mod:
            mod = a % 10
if not flag:
    mod = 0
print(_sum - 10 + mod)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
mod = 10
_sum = 0
flag = False
for a in (A,B, C, D, E):
    if a % 10 == 0:
        _sum += a
    else:
        flag = True
        _sum += a + 10 - a % 10
        if a % 10 < mod:
            mod = a % 10
if not flag:
    mod = 0
print(_sum - 10 + mod)

Submission status: Wrong Answer

Solution code:
def int_ceil(x):
  last=int(sorted(str(x),reverse=True)[0])
  return([x+10-last,last])

dishes =[0]*5
min=10
for i in range(5):
  x=(int(input()))
  if x % 10 != 0:
    ceiled=int_ceil(x)
    if ceiled[1] < min:
      min=ceiled[1]
    dishes[i]=ceiled[0]
  else:
    dishes[i]=x

print(sum(dishes) - 10 + min)

Submission status: Wrong Answer

Solution code:
SUM = 0
MIN = 9999
cnt = -1
for i in range(5):
    s = int(input())
    smod = int(s % 10)
    if smod == 0:
        SUM += s
    else:
        SUM += s - smod + 10
        cnt += 1
        MIN = min(MIN,smod)
print(SUM - 10 + MIN)

Submission status: Wrong Answer

Solution code:
SUM = 0
MIN = 9999
cnt = -1
for i in range(5):
    s = int(input())
    smod = int(s % 10)
    if smod == 0:
        SUM += s
    else:
        SUM += s - smod
        cnt += 1
        MIN = min(MIN,smod)
print(SUM + MIN + (10 * cnt))

Submission status: Wrong Answer

Solution code:
SUM = 0
MIN = 9999
for i in range(5):
    s = int(input())
    smod = int(s % 10)
    if smod == 0:
        SUM += s
    else:
        SUM += s - smod + 10 
        MIN = min(MIN,smod)
print(SUM + MIN - 10)

Submission status: Wrong Answer

Solution code:
import math
def resolve():
    a = list(int(input()) for _ in range(5))
    mint = 1000
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
        if a[i]%10 == 0: continue
        mint = min(mint,a[i]%10)
    print(ans+mint-10)
resolve()

Submission status: Wrong Answer

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

#注文するべき順番は下一桁が０であるのが最強、１が最弱９は０にだけまける。下一桁を０にしたやつを足す
#これ順番はどうでもよい？
#要は注文時間の下一桁切り上げを足せってことですかね？
#最後の料理は０に切り上げる必要がないね
import math
a=10*(math.ceil(A/10))
b=10*(math.ceil(B/10))
c=10*(math.ceil(C/10))
d=10*(math.ceil(D/10))
e=10*(math.ceil(E/10))
Q=max(a-A,b-B,c-C,d-D,e-E)
if Q==a-A:
    print(b+c+d+e+A)
elif Q==b-B:
    print(b+c+d+e+B)
elif Q==c-C:
    print(b+c+d+e+C)
elif Q==d-D:
    print(b+c+d+e+D)
elif Q==e-E:
    print(b+c+d+e+E)

Submission status: Wrong Answer

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

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

order_list = []
for x in X:
    priority = x % 10
    if priority == 0:
        priority = 10
    order_list.append([x, priority])

order_list.sort(key=lambda order: order[1])

total_time = 0
for time, priority in order_list[1:]:
    plus10 = 0
    if time % 10 > 0:
        plus10 = 10
    actual_time = time//10*10 + plus10
    total_time += actual_time
    print([time, priority], actual_time, total_time)

order = order_list.pop(0)
time = order[0]
total_time += time

print(total_time)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline

s = [int(input()) for i in range(5)]

m = 9999
for i in s:
    t = i
    for j in s:
        if i != j:
            t += j if j%10 == 0 else j + 10-j%10
    m = min(m, t) 

print(m)

Submission status: Wrong Answer

Solution code:
mlist = [int(input()) for i in range(5)]
minmin = 10
cnt = 0
for i in mlist:
  if i%10 != 0:
    minmin = min(minmin,i%10)
  else:
    cnt+=1
ans = 0
for i in mlist:
  ans += (i//10 +1)*10
if cnt <5:
  ans = ans + minmin - 10
else:
  ans = sum(mlist)
print(ans)

Submission status: Wrong Answer

Solution code:
mlist = [int(input()) for i in range(5)]
minmin = 10
for i in mlist:
  if i%10 != 0:
    minmin = min(minmin,i%10)
ans = 0
for i in mlist:
  ans += (i//10 +1)*10
ans = ans + minmin - 10
print(ans)

Submission status: Wrong Answer

Solution code:
mlist = [int(input()) for i in range(5)]
minmin = 10
for i in mlist:
  minmin = min(minmin,i%10)
ans = 0
for i in mlist:
  ans += (i//10 +1)*10
ans = ans + minmin - 10
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import permutations
from math import ceil
    
  
time_list = []
for i in range(5):
    time_list.append(int(input()))


min_time = float('inf')


for order in list(permutations([0,1,2,3,4])):
    total = 0
    for i in range(5):
        total += time_list[order[i]]
        if i!=4:
            total = ceil(total / 10) * 10
        print(total)
    min_time = min(min_time, total)
   
  
print(min_time)

Submission status: Wrong Answer

Solution code:

sum=0
m=9
for i in range(5):
  dish=int(input())
  if dish%10==0:
    sum+=dish
  else:
    sum+=dish+10-dish%10
    m=min(m,dish%10)
print(sum-10+m)

Submission status: Wrong Answer

Solution code:

sum=0
m=9
for i in range(5):
  dish=int(input())
  if dish%10==0:
    sum+=dish
  else:
    sum+=dish+10-dish%10
    m=min(m,dish%10)
print(sum-10+dish%10)

Submission status: Wrong Answer

Solution code:
def round_up(i):
    if i % 10 == 0:
        return i
    return 10 - i % 10 + i


l = [int(x[0]) for x in [input().split() for x in range(5)]]

s = 9
index = 5
acc = []
for i in range(5):
    tmp = l[i] % 10
    if tmp != 0 and tmp < s:
        s = tmp
        index = i
    acc.append(round_up(l[i]))

print(sum(acc) - (10 - s))