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:
A=list([int(input()) for i in range(5)])
ans=0
B=[]
for i in range(5):
    if A[i]%10!=0:
        B.append(A[i]%10)
for i in range(5):
    if A[i]%10==0:
        ans+=A[i]
    else:
        ans+=(A[i]//10+1)*10
        if A[i]%10==min(B):
            ans-=(10-A[i]%10)
print(ans)

Submission status: Wrong Answer

Solution code:
foods = [int(input()) for i in range(5)]
  
time = 0
tmp = []

for i in foods:
  if i % 10 == 0:
    time += i
  else:
    tmp.append(i)

minmod = 9
for i in tmp:
  mod = i % 10
  time += i + (10 - mod)
  if mod < minmod:
    minmod = mod

print(time - 10 + minmod)

Submission status: Wrong Answer

Solution code:
foods = [int(input()) for i in range(5)]
  
time = 0
tmp = []

for i in foods:
  if i % 10 == 0:
    time += i
  else:
    tmp.append(i)

minmod = 9
for i in tmp:
  if i % 10 < minmod:
    minmod = i % 10
  time += i + (10 - i % 10)

print(time - 10 + minmod)

Submission status: Wrong Answer

Solution code:
l=list(int(input()) for _ in range(5))
s=list(10-i%10 for i in l)
s.remove(max(s))
print(sum(l)+sum(s))

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(5)]
key = 10-a[0]%10
last =a[0]
for i in range(1,5):
    x=10-a[i]%10
    if x >= key:
        if a[i]>=last:
            last=a[i]
        key=x
a.pop(a.index(last))
modtotal=0
for i in a:
    modtotal+=10-i%10
total=sum(a)+modtotal+last
print(total)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for _ in range(5)]
mini = 9
for i in [j for j in A if j%10 != 0]:
    mini = min(mini,i%10)
ans = 0
for i in A:
    if i%10==0:
        ans += i
    else:
        ans += (i//10+1)*10
print(ans-10+mini)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for _ in range(5)]
mini = 9
for i in [j for j in A if j%10 != 0]:
    mini = min(mini,i%10)
print(mini)
ans = 0
for i in A:
    if i%10==0:
        ans += i
    else:
        ans += (i//10+1)*10
print(ans-10+mini)

Submission status: Wrong Answer

Solution code:
A=list(int(input()) for _ in range(5))
B=[]
C=[]
for i in A:
    if i%10!=0:
        B.append(i%10)
        C.append((i//10+1)*10)
    else:
        C.append(i)
if B==True:
    c=10-min(B)
else:
    c=0
print(sum(C)-c)

Submission status: Wrong Answer

Solution code:
import math
list=[int(input()) for x in range(5)]
ans=[]
for l in list:
  ans.append(math.ceil(l/10)*10)
print(sum(ans))

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    l=[input() for i in range(5)]
    sum=0
    for j in range(5):
        sum+=(int(l[j])//10)*10
    num=9
    for n in range(5):
        if int(l[n][-1])!=0 and int(l[n][-1]) < num:
            num=int(l[n][-1])
    if num!=0:
        sum-=10-num
    for s in range(5):
        if int(l[s])%10!=0:
            sum+=10
    print(sum)
resolve()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    l=[input() for i in range(5)]
    sum=0
    for j in range(5):
        sum+=(int(l[j])//10)*10
    num=9
    for n in range(5):
        if int(l[n][-1])!=0 and int(l[n][-1]) < num:
            num=int(l[n][-1])
    sum-=10-num
    for s in range(5):
        if int(l[s])%10!=0:
            sum+=10
    print(sum)
resolve()

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

input = sys.stdin.readline


x = []
for _ in range(5):
    x.append(int(input()))


min_x = 9
flag = False
cnt = 0

y = []

for a in x:
    if a%10 != 0:
        y.append((a//10)*10+10)
        min_x = min(a%10,min_x)
    else:
        y.append(a)

print(sum(y)-(10-min_x))

Submission status: Wrong Answer

Solution code:
arr = []
for _ in range(5):
  x = int(input())
  if 0 < x <= 10:arr.append(10)
  else:
    x//=10
    arr.append(x*10)
    
print(sum(arr))

Submission status: Wrong Answer

Solution code:
foods = [int(input()) for i in range(5)]
amari = [i % 10 for i in foods]
kiriage = [-(-i//10) for i in foods]
print(sum(kiriage) * 10 - (10 - (10 if max(amari) == 0 else max(1, min(amari)))))

Submission status: Wrong Answer

Solution code:
dishes = [int(input()) for i in range(5)]
min_dish = dishes.pop(dishes.index(min(dishes)))
sum = 0
for d in dishes:
  sum += -int(-d / 10) * 10
print(sum + min_dish)

Submission status: Wrong Answer

Solution code:
dishes = [int(input()) for i in range(5)]
min_dish = dishes.pop(dishes.index(min(dishes)))
sum = 0
for d in dishes:
  sum += -int(-d)
print(sum + min_dish)

Submission status: Wrong Answer

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

d = 10
ans = 0
if A % 10 == 0:
    ans += A
else:
    ans += (A//10+1)*10
    d = min(A - A//10*10, d)

if B % 10 == 0:
    ans += B
else:
    ans += (B//10+1)*10
    d = min(B - B//10*10, d)

if C % 10 == 0:
    ans += C
else:
    ans += (C//10+1)*10
    d = min(C - C//10*10, d)

if D % 10 == 0:
    ans += D
else:
    ans += (D//10+1)*10
    d = min(D - d//10*10, d)
    
if E % 10 == 0:
    ans += E
else:
    ans += (E//10+1)*10
    d = min(E - E//10*10, d)

if d != 10:
    ans -= 10 - d
    
print(ans)

Submission status: Wrong Answer

Solution code:
ret=0
m=10
for _ in range(5):
  y=int(input())
  ret+=(y+9)//10
  if y%10!=0:
    m=min(m,y%10)
print(ret-(10-m))

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(5)]
ans=0
m=[0]*5
count=0
for i in range(5):
  m[i]=l[i]%10
for i in range(5):
  if count==0 and l[i]%10==min(m):
    ans+=l[i]
    count+=1
  else:
    ans+=(-((-l[i])//10))*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(sum(B)+sum(A)-max(B))
print(B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num=0
L=list(input() for i in range(5))
M=sorted(list(int(i[-1]) for i in L))
L=list(int(i) for i in L)
M.pop(0)
M=list(10-i for i in M)
print(sum(M)+sum(L))

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

abcde = list(map(int, read().split()))
check = sorted([abcde[0] % 10, abcde[1] % 10, abcde[2] % 10, abcde[3] % 10, abcde[4] % 10])
for i in range(5):
    if check[0] == 0:
        check.pop(0)
    else:
        break
if not check:
    check = [0]
ans = 0
for v in abcde:
    if v % 10 == check[0] or v % 10 == 0:
        ans += v
    else:
        ans += (v - v % 10) + 10
print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    if len(b) == 0:
        amin = 0
    else:
        amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()

Submission status: Wrong Answer

Solution code:
A = []
ans = 0
for _ in range(5):
  a = int(input())
  if a % 10 == 0: ans += a
  else: A.append(a)
A.sort(key = lambda x:x%10)
for i in range(1, len(A)+1):
  if A[-i] != A[0]:ans += 10 - (A[-i]%10) + A[-i]
  else: ans += A[-i]
print(ans)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for i in range(5)]
d = 9
ans = 0
for a in A:
    ans += 0--a//10*10
    if a%10:
        d = min(d,a%10)
print(ans - 10 + d)

Submission status: Wrong Answer

Solution code:
S=[int(input()) for i in range(5)]
R=list(S)
for i in range(5):
    R[i]=R[i]%10
L=sorted(R)[::-1]

total=S[0]+S[1]+S[2]+S[3]+S[4]
mati=(10-L[0])+(10-L[1])+(10-L[2])+(10-L[3])
print(total+mati)

Submission status: Wrong Answer

Solution code:
menu=[int(input()) for i in range(5)]
fir_digi=[menu[i]%10 for i in range(5)]
for i in range (5):
    if i!=fir_digi.index(min(fir_digi)) and fir_digi[i]!=0:
            menu[i]=int(menu[i]/10)*10+10
print(sum(menu))

Submission status: Wrong Answer

Solution code:
menu,fir_digi=[int(input()) for i in range(5)],[]
for i in range (5):
    fir_digi.append(menu[i]%10)
for i in range (5):
    if i!=fir_digi.index(min(fir_digi)) and fir_digi[i]!=0:
            menu[i]=int(menu[i]/10)*10+10
print(sum(menu))

Submission status: Wrong Answer

Solution code:
icase=0
if icase==0:
    from itertools import permutations, combinations,combinations_with_replacement,product
    a=[0]*5
    for i in range(5):
        a[i]=int(input())
    tmin=123*5
    alist=list(permutations(a))
    for ai in alist:
        t=ai[0]
        t=int((t-1)//10+1)*10+ai[1]
        t=int((t-1)//10+1)*10+ai[2]
        t=int((t-1)//10+1)*10+ai[3]
        t=int((t-1)//10+1)*10+ai[4]
        tmin=min(t,tmin)
    print(tmin)

Submission status: Wrong Answer

Solution code:
t=[]
max_time=999
for i in range(5):
    t.append(int(input()))
    if (t[i]%10)<max_time and (t[i]%10)!=0:
        max_time=(t[i]%10)
    if t[i]%10!=0:
        t[i]+=10-(t[i]%10)
print(sum(t)-(10-max_time))

Submission status: Wrong Answer

Solution code:
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 10
for i in range(len(A)):
    if A[i]%10 < Max:
        Max = i
for i in range(len(A)):
    if i != Max:
        cnt += A[i]
    while cnt%10 != 0:
        cnt += 1
print(cnt+A[Max])

Submission status: Wrong Answer

Solution code:
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 0
for i in range(len(A)):
    if A[i]%10 > Max:
        Max = i
for i in range(len(A)):
    if i != Max:
        cnt += A[i]
    while cnt%10 != 0:
        cnt += 1
print(cnt+A[Max])

Submission status: Wrong Answer

Solution code:
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 0
for i in A:
    if i%10 > Max:
        Max = i
for i in A:
    if i != Max:
        cnt += i
    while cnt%10 != 0:
        cnt += 1
print(cnt+Max)

Submission status: Wrong Answer

Solution code:
# nabc123_b.py
# 調理時間%10=0 をとった後、調理時間%10 が大きい順にとって行く
dishes = [int(input()) for i in range(5)]
lest_time = 0
ans = 0
for dish in dishes:
    if dish%10==0:
        ans += (dish)
    else:
        ans += (dish+10-dish%10)
    if lest_time < 10-dish%10 and dish%10!=0:
        lest_time = 10-dish%10
    print(ans,dish,lest_time)
print(ans-lest_time)

Submission status: Wrong Answer

Solution code:
# AtCoder

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

n = len(lst)
diffs = []
for i in range(n):
    dif = 10 - int(str(lst[i])[-1])
    diffs.append(dif)

if sum(diffs) == 50:
    print(sum(lst))
    exit()

mx = max(diffs)
s = []
for i in diffs:
    if i == 10:
        continue
    s.append(i)
print(sum(s)+sum(lst))

Submission status: Wrong Answer

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

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
M = min(A+1,B+1,C+1,D+1,E+1)
print(a+b+c+d+e+A+B+C+D+E-(M-1))

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
M = min(A+1,B+1,C+1,D+1,E+1)
print(a+b+c+d+e+A+B+C+D+E-M)

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
M = min(A,B,C,D,E)
print(a+b+c+d+e+A+B+C+D+E-M)

Submission status: Wrong Answer

Solution code:
import math
A = [int(input()) for _ in range(5)]
B = 10
ans = 0
for i in range(5):
  if A[i] % 10 < B and A[i] > 0:
    B = A[i] % 10
    ans = -10+B
for j in A:
  ans += math.ceil(j)
print(ans)

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()))
count=0
rem=10
for t in A:
    if t%10==0:
        count+=t
    else:
        count+=(((t//10)+1)*10)
        if t%10<10:
            rem=t%10
print(count-10+rem)

Submission status: Wrong Answer

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

MIN = 0
ans = 0
for i in (A,B,C,D,E):
    if i % 10 != 0:
        MIN = min(MIN, i % 10)
        ans += i - i % 10 + 10
    else:
        ans += i
ans -= MIN
print(ans)

Submission status: Wrong Answer

Solution code:
import math
list = [input() for i in range(5)]
one_min = 9
for i in range(5):
    if one_min >= int(list[i][-1]) > 0:
        one_min = int(list[i][-1])
sum = 0
for i in range(5):
    sum += math.ceil(int(list[i])/10)*10
print(sum - 10 + one_min)

Submission status: Wrong Answer

Solution code:
A = []
B = []
C = []
for i in range(5):
    A.append(int(input()))
    B.append((A[i]//10+1)*10)
    C.append(B[i]-A[i])
sb = sum(B)
ans = sb
for i in range(5):
    ans = min(ans,sb-C[i])
print(ans)

Submission status: Wrong Answer

Solution code:
mx = 0
s = 0
for _ in range(5):
  ai = int(input())
  if ai%10 == 0:
    s += ai
  else:
    s += ai//10+10
    if 10-ai%10 > mx:
      mx = 10-ai%10
print(s-mx)

Submission status: Wrong Answer

Solution code:

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

max_a_idx = -1
max_dif = 0
for i in range(5):
    if a[i]%10!=0:
        x = 10-(a[i]%10)
        if x > max_dif:
            max_dif=x
            max_a_idx=i


time = 0
for i in range(5):
    if i!=max_a_idx:
        if a[i]%10!=0:
            time += (a[i]+(10-a[i]%10))
        else:
            time += a[i]
        #print(str(a[i])+" "+str(time))

time += a[max_a_idx]
print(time)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for i in range(5)]
B = [10 - a % 10 for a in A]
print(sum(A) + sum(B) - max(B))

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(5)]
mod=sorted([10-n%10 for n in l])
c=mod.count(10)
print(sum(l)+sum(mod)-mod[4-c]-10*c)

Submission status: Wrong Answer

Solution code:
ans_list = []
z_count = 0
for i in range(5):
    b = int(input())
    c = b%10
    ans_list.append((b,c))
    if c == 0:
        z_count += 1
ans_list.sort(key = lambda x:x[1], reverse = True)
count = 0
ans = 0
for i in range(5-z_count):
    if ans_list[i][1] is not 0:
        ans += (ans_list[i][0] -ans_list[i][1] + 10)
    else:
        ans += ans_list[i][0]
ans -=(10-ans_list[5-z_count-1][1])
for i in range(z_count):
    ans += ans_list[5-z_count+ i][0]

print(ans)

Submission status: Wrong Answer

Solution code:
data = []

for _ in range(5):
  data.append(int(input()))

# 10の倍数から1番離れてる数がどれか
min = 99
margin = []
for d in data:
  tmp = d % 10
  if tmp != 0:
    margin.append(10 - tmp)
  if tmp != 0 and min > tmp:
    min = tmp

# print(data)
# print(margin)
# print(min)
print(sum(data) + sum(margin) - (10-min))

Submission status: Wrong Answer

Solution code:
A=[int(input()) for _ in range(5)]
ans=0
for i in range(4):
  if A[i]%10==0:
    ans+=A[i]
  else:
    ans+=((A[i]//10)+1)*10
print(ans+A[-1])

Submission status: Wrong Answer

Solution code:
from itertools import permutations
import math
menu = 5
times = [int(input()) for i in range(menu)]
orders = list(permutations(times,menu))
minimum = sum(math.ceil(time/10)*10 for time in times)
for order in orders:
  total = order[0]
  for i in range(1,menu):
    total = math.ceil(order[i]/10)*10
  minimum = min(minimum,total)
print(minimum)

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=INT()
    b=INT()
    c=INT()
    d=INT()
    e=INT()
    ct=0
    alls=[a,b,c,d,e]
    for i in alls:
        if i%10!=0:
            ct+=(i//10+1)*10
        else:
            ct+=i
    f=min(a%10,b%10,c%10,d%10,e%10)
    if f!=0:
        ct=ct-(10-f)
    print(ct)
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=INT()
    b=INT()
    c=INT()
    d=INT()
    e=INT()
    ct=0
    alls=[a,b,c,d,e]
    for i in alls:
        if i%10!=0:
            ct+=(i//10+1)*10
        else:
            ct+=i
    ct=ct-(10-min(a%10,b%10,c%10,d%10,e%10))
    print(ct)
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:
a = [list(map(int, input().split())) for _ in range(5)]
mod = 9
ans = 0

for i in range(5):
    modi = (a[i][0]%10)
    if modi != 0:
        mod = min(mod, modi)
    ref = (0 - -a[i][0]//10)*10
    ans += ref

mod = 10 - mod
ans = ans - mod
print(ans)

Submission status: Wrong Answer

Solution code:
li = [int(input()) for _ in range(5)]

def fun(a):
    return a + 10 - a % 10

su = sum([fun(l) if l % 10 != 0 else l for l in li])
last = li[0]
for l in li:
    if last % 10 > l % 10 and l % 10 != 0:
        last = l
print(su - fun(last) + last)

Submission status: Wrong Answer

Solution code:
li = [int(input()) for _ in range(5)]

def fun(a):
    return a + 10 - a % 10

su = sum([fun(l) if l % 10 != 0 else l for l in li])
last = 9
for l in li:
    if last % 10 > l % 10 and l % 10 != 0:
        last = l
print(su - fun(last) + last)

Submission status: Wrong Answer

Solution code:
import sys

dishes = map(int, sys.stdin.read().split())
ans = 0
d = 10
for dish in dishes:
    if dish % 10  < d:
        ans += 10 - d
        d = dish % 10
    else:
        ans += dish + 10 - dish % 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 = [a,b,c,d,e]
l1 = [a%10,b%10,c%10,d%10,e%10]
l2 = [(a//10)*10+10,(b//10)*10+10,(c//10)*10+10,(d//10)*10+10,(e//10)*10+10]
for i in range(len(l)):
    if l[i]%10 == 0:
        l1[i] = 10
        l2[i] -= 10
print(sum(l2))
print((sum(l2)-(10-(min(l1)))))

Submission status: Wrong Answer

Solution code:
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
s = [a%10,b%10,c%10,d%10,e%10]
g = max(s)
for i in range(len(s)):
    if s[i]:
        g = min(g,s[i])
k = [a,b,c,d,e]
for i in range(len(k)):
    k[i] = math.ceil(k[i]/10)*10
print(sum(k)+g-10)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
ansa=0
ansb=0
ansc=0
ansd=0
anse=0

if str(a)[-1]=="0":
  ansa=0
else:
  ansa=str(a)[-1]
  ansa=10-int(ansa)
  
if str(b)[-1]=="0":
  ansb=0
else:
  ansb=str(b)[-1]
  ansb=10-int(ansb)
  
if str(c)[-1]=="0":
  ansc=0
else:
  ansc=str(c)[-1]
  ansc=10-int(ansc)
  
if str(d)[-1]=="0":
  ansd=0
else:
  ansd=str(d)[-1]
  ansd=10-int(ansd)
  
if str(e)[-1]=="0":
  anse=0
else:
  anse=str(e)[-1]
  anse=10-int(anse)
  
sum1=ansa,ansb,ansc,ansd,anse
ans1=sum(sum1)-max(sum1)

ans2=a+b+c+d+e

Submission status: Wrong Answer

Solution code:
l =list(int(input()) for i in range(5))
a =[]
time = 0
for i in range(5):
  if l[i]%10!=0:
    a.append(l[i]%10)
  else:
    a.append(9)
#print(a)
b = a.index(min(a))
#print(b)
for i in range(5):
  time += (-(-l[i]//10))*10
  print(time)
time -= (-(-l[b]//10)*10) - l[b]
print(time)

Submission status: Wrong Answer

Solution code:
l =list(int(input()) for i in range(5))
a =[]
time = 0
for i in range(5):
  a.append(l[i]%10)
#print(a)
b = a.index(min(a))
#print(b)
for i in range(5):
  time += (-(-l[i]//10))*10
time -= (-(-l[b]//10)*10) - l[b]
print(time)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for i in range(5)]
cnt = 0
res = 9
for i in A:
  cnt += (i + 9)//10
  res = min(res,i%10)

print(cnt*10+res)

Submission status: Wrong Answer

Solution code:
from math import ceil
A = [int(input()) for _ in range(5)]
A.sort(reverse=True)
total = 0
for i in range(4):
  total += ceil(A[i] / 10) * 10
total += A[-1]
print(total)

Submission status: Wrong Answer

Solution code:
a=sorted(list(map(int,[input()for i in range(5)])),key=lambda x:x%10)
if ''.join([str(i)[-1]for i in a])=='00000':print(sum(a));quit()
while str(a[0])[-1]=='0':
  a+=[a[0]]
  del a[0]
print(a)
print(sum([a[0]]+[10*(0--i//10)for i in a[1:]]))

Submission status: Wrong Answer

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

import itertools

ls = [A, B, C, D, E]
p = list(itertools.permutations(ls, 5))
ans = 124*5
for i,v in enumerate(p):
    t = 0
    for j in range(5):
        if t%10 != 0:
            t += 10- t%10
        t += v[j]

    ans = min(t,ans)
print(ans)

Submission status: Wrong Answer

Solution code:
abcde = []
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))

minVal = 0
total = 0
for x in abcde:
    mod = x % 10
    if minVal == 0 and mod != 0:
        minVal = mod

    if minVal != 0 and mod != 0 and mod < minVal:
        minVal = mod

    if mod == 0:
        total += x - mod
    else:
        total += x + 10 - mod

total += minVal - 10
print(total)

Submission status: Wrong Answer

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


dishes = [A, B, C, D, E]
tens = 0
ones = 9
muda = 10
for d in dishes:
    if d % 10 == 0:
        tens += d // 10
    else:
        tens += d // 10 + 1
        if d % 10 < ones:
            muda = d
            ones = d % 10

#%%
if muda % 10 == 0:
    ans = tens * 10
else:
    ans = tens * 10 - (10 - muda % 10)
print(ans)

Submission status: Wrong Answer

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


dishes = [A, B, C, D, E]
tens = 0
ones = 9
muda = 0
for d in dishes:
    if d % 10 == 0:
        tens += d // 10
    else:
        tens += d // 10 + 1
        if d % 10 < ones:
            muda = d
            ones = d % 10

#%%
ans = tens * 10 -  (10 -muda % 10)

print(ans)

Submission status: Wrong Answer

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

total = 0
min_mod = 9
for t in (a,b,c,d,e):
  total += (t + 9) // 10
  if t%10 != 0:
    min_mod = min(t%10, min_mod)

ans = (total - 1) * 10 + min_mod
print(ans)

Submission status: Wrong Answer

Solution code:
time = []
rem = []
for _ in range(5):
    n = int(input())
    time.append(n)
    if n % 10 != 0:
        rem.append(10 - n % 10)

rem.sort()
ans = sum(time) + sum(rem[:4])
# print(time, rem)
print(ans)

Submission status: Wrong Answer

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

Menu = [A,B,C,D,E]
ans = 0
mint = 9

for i in Menu :
    ans += (i+9)//10
    if i%10 != 0 :
        mint = min(i%10, mint)

ans = ans * 10 - 10 + mint
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import permutations
A_list = []
for i in range(5):
    A = int(input())
    A_list.append(A)
nes = [0,1,2,3,4]
iterator = []
for i in permutations(nes):
    iterator.append(i)
min1 = 10**9
for i in iterator:
    temp = 0
    for j in i:
        if temp%10 != 0:
            temp += (10-temp%10)
        temp += A_list[j]
    if temp < min1:
        min1 = temp
print(temp)

Submission status: Wrong Answer

Solution code:
from itertools import permutations
A_list = []
for i in range(5):
    A = int(input())
    A_list.append(A)
nes = [0,1,2,3,4]
iterator = []
print(A_list)
for i in permutations(nes):
    iterator.append(i)
min1 = 10**9
for i in iterator:
    temp = 0
    for j in i:
        if temp%10 != 0:
            temp += (10-temp%10)
        temp += A_list[j]
    if temp < min1:
        min1 = temp
print(temp)

Submission status: Wrong Answer

Solution code:
A=[]
B=[]
C=[]
total=0
for i in range(5):
    A.append(int(input()))
for i in range(5):
    B.append(10-((A[i]%10)%10))
    C.append(((A[i]//10)+1)*10)
    total+=C[i]
B=sorted(B,reverse=True)
print(B)
print(total-B[0])

Submission status: Wrong Answer

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

def k (x):
            if x% 10 != 0:
                        return x-x%10+10
            else:
                        return x          
def m(y):
            if y%10 !=0:
                        return  y%10
            else:
                        return 9
a,b,c,d,e=map(k,[A,B,C,D,E])
a_list = [a,b,c,d,e]
a_1,b_1,c_1,d_1,e_1=map(m,[A,B,C,D,E])
s=sum(a_list)-10+min(a_1,b_1,c_1,d_1,e_1)
print(s)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math


def main():
    ABCDE = [int(input()) for _ in range(5)]
    result = 0
    m = 10
    for i in ABCDE:
        result += math.ceil(i / 10) * 10
        if i % 10 != 0:
            m = min(m, i % 10)
    print(result + m % 10 - 10)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
cooks = [int(input()) for _ in range(5)]
sorted_cooks = sorted(cooks, key=lambda x: -int(str(x)[-1]))
ans = 0
for i in range(len(sorted_cooks)):
  if(i < len(sorted_cooks) - 1):
    ans += math.ceil(sorted_cooks[i] / 10) * 10
  else:
    ans += sorted_cooks[i]
print(ans)

Submission status: Wrong Answer

Solution code:
d=[]

for i in range(5):
    s=int(input())
    d.append((s,s+(10-s%10),10-s%10))

d.sort(key=lambda d:d[2])
result=0
result=sum(d[i][1] for i in range(len(d)-1)) + d[-1][0]

print(result)

Submission status: Wrong Answer

Solution code:
dishes = [input() for _ in range(5)]
hoge = sorted(dishes, key=lambda x: -int(x[-1]) if x[-1] != '0' else -(10 ** 10))
hoge = [int(i) for i in hoge]
print(sum(hoge[:-1]) + hoge[-1])

Submission status: Wrong Answer

Solution code:
m = 9
l = []
r = []
for i in range(5):
  a = int(input())
  if a % 10 != 0:
    m = 10 - a % 10
    b = a + a % 10
    l.append(b)
    r.append(m)
  else:
    l.append(a)
    r.append(0)
r.sort()
print(sum(l) - r[-1])

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a,b,c,d,e]
last = 9
ttl = 0
for i in range(5):
    if lst[i]%10 != 0:
        ttl += (lst[i]+(10-lst[i]%10))
    if lst[i]%10 == 0:
        ttl += lst[i]
    if 0 <(lst[i]%10) <= last:
        last = lst[i]%10
print(ttl-(10-last))

Submission status: Wrong Answer

Solution code:
m=[]
cnt=0
for i in range(5):
    x=int(input())
    m.append(x)
m10=[i % 10 for i in m if i %10 >=1]
if m10:
    t=min(m10)
    for i in m:
        if i %10==0:
            cnt += i
        else:
            cnt += ((i//10)+1)*10
    print(cnt-10+t)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
lis = []
cnt = 0
for i in range(5):
    val = 0
    a = int(input())
    while a % 10 != 0:
        a += 1
        val += 1
    lis.append(a)
    if val > cnt:
        cnt = val
print(cnt)
ans = sum(lis)
print(ans - cnt)

Submission status: Wrong Answer

Solution code:
a=[ int(input()) for i in range(5)]
b=[(a[i]-1)%10 for i in range(5)]
m=10-((min(b)+1)%10)
def f(x):
  if x%10==0:
    return x
  else:
    return x-(x%10)+10
ans=-m
for i in range(5):
  ans+=f(a[i])
print(ans)

Submission status: Wrong Answer

Solution code:
#125 b
def age(x):
    if x%10==0:
        return x
    else:
        return x+10-x%10

r=[]
amari=[]
amari_new=[]
amari_min=10
ans=0
for i in range(5):
    d=int(input())
    amari.append(d%10)
    r.append(age(d))

for x in range(5):
    if x!=0 and amari_min>x:
        amari_min=x
ans+=sum(r)


for x in amari:
    if x!=0:
        amari_new.append(x)

if amari_new:
    amari_min=min(amari)
    ans-=10-amari_min

print(ans)

Submission status: Wrong Answer

Solution code:
#125 b
def age(x):
    if x%10==0:
        return x
    else:
        return x+10-x%10

r=[]
amari=[]
amari_min=10
ans=0
for i in range(5):
    d=int(input())
    amari.append(d%10)
    r.append(age(d))

for x in range(5):
    if x!=0 and amari_min>x:
        amari_min=x
ans+=sum(r)


for x in amari:
    if x==0:
        amari.remove(x)
if amari:
    amari_min=min(amari)
    ans-=10-amari_min


print(ans)

Submission status: Wrong Answer

Solution code:
#125 b
def age(x):
    if x%10==0:
        return x
    else:
        return x+10-x%10

r=[]
amari=[]
amari_min=10
ans=0
for i in range(5):
    d=int(input())
    amari.append(d%10)
    r.append(age(d))

for x in range(5):
    if x!=0 and amari_min>x:
        amari_min=x
ans+=sum(r)


for x in amari:
    if x==0:
        amari.pop()
if amari:
    amari_min=min(amari)
    ans-=10-amari_min


print(ans)