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

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import itertools
import numpy as np
l = [int(input()) for c in range(5)]
#10で割った余りが1以上で最も小さいものを探す
tmp = 1
cnt = 5
for i in range(5):
    if tmp < 10 - l[i]%10 and l[i]%10!=0:
        tmp = 10 - l[i]%10
        cnt = i
res = 0
for i in range(5):
    if cnt == i:
        res+=l[i]
    else:
        if l[i]%10==0:
            res+=l[i]
        else:
            res+=l[i]+10-l[i]%10

print(res)

Submission status: Wrong Answer

Solution code:
# ABC123
# Five Dishes
#B=A R=B G=C P=D T=E
Ryori = [input() for _ in range(5)]
O = []
t = 0
for i in Ryori:
    print(i)
    if int(i[-1]) == 0:
        x = Ryori.pop(Ryori.index(i))
        O.append(x)
Ryori = sorted(Ryori,key=lambda x: x[-1], reverse=True)

for i in range(len(Ryori)-1):
    for j in range(10):
        if (int(Ryori[i]) + j) % 10 == 0:
            t += int(Ryori[i]) + j
t += int(Ryori[-1])

for i in O:
    t += int(i)
print(t)

Submission status: Wrong Answer

Solution code:
ans=0
t=[]
tmp=10
for i in range(5):
    t.append(int(input()))
    if t[i]%10!=0 and t[i]%10<tmp:
        tmp=t[i]%10
print(tmp)
flg=0
for i in range(5):
    if (t[i]%10!=tmp or flg==1) and t[i]%10==0:
        ans+=t[i]
    elif (t[i]%10!=tmp or flg==1) and t[i]%10!=0:
        ans+=(t[i]//10+1)*10
    elif t[i]%10==tmp and flg==0:
        ans+=t[i]
        flg=1
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=[a,b,c,d,e]
f.sort()
x=0
for i in range(5):
  if f[i]%10==0:
    x=x+f[i]
  if f[i]%10!=0:
    x=x+(f[i]//10)*10+10
g=a-(a//10)*10
h=b-(b//10)*10
i=c-(c//10)*10
j=d-(d//10)*10
k=e-(e//10)*10
l=[g,h,i,j,k]
l.sort()
y=0
z=0
for i in range(5):
  if l[i]!=0:
    y=y+1
    z=i
    break
print(x-(10-l[z]))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=[a,b,c,d,e]
f.sort()
x=0
for i in range(5):
  if f[i]%10==0:
    x=x+f[i]
  if f[i]%10!=0:
    x=x+(f[i]//10)*10+10
g=a-(a//10)*10
h=b-(b//10)*10
i=c-(c//10)*10
j=d-(d//10)*10
k=e-(e//10)*10
l=[g,h,i,j,k]
l.sort()
print(x-(10-l[0]))

Submission status: Wrong Answer

Solution code:
menu=[]
menu2=[]
total=False
c=0
total2=0
for i in range(5):
    a=int(input())
    menu.append(a)
    menu2.append(a%10)
    if a%10==0:
        total2+=1
for i in range(1,10):
    for k in range(5):
        if menu2[k]==i:
            total=True
            c=k
            break
    if total==True:
        break
print(sum(menu)+10*(4-total2)-sum(menu2)+menu2[c])

Submission status: Wrong Answer

Solution code:
menu=[]
total=10
c=0
for i in range(5):
    a=int(input())
    b=a%10
    if 0<b<=9:
        if total>b:
            total=b
            menu.append(a)
        else:
            menu.append(a+10-b)
    else:
        menu.append(a)
print(sum(menu))

Submission status: Wrong Answer

Solution code:
menu=[]
total=10
c=0
for i in range(5):
    a=int(input())
    b=a%10
    if 0<b<9:
        if total>b:
            total=b
            c=i
            menu.append(a)
        else:
            menu.append(a+10-b)
    else:
        menu.append(a+10-b)
print(sum(menu))

Submission status: Wrong Answer

Solution code:
l = []
for i in range(5):
    l.append(int(input()))
amari = []
for i in range(5):
    amari.append(l[i]%10)
jikan = []
for i in range(5):
    if amari[i] == 0:
        jikan.append(l[i])
    else :
        jikan.append(l[i] + (10-amari[i]))

print(sum(jikan) - (10-min(amari)))

Submission status: Wrong Answer

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

num=0
su=0
for i in l:
  a=round(i+5,-1)
  su+=a
  num=max(num,a-i)
  
print(su-num)

Submission status: Wrong Answer

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

res = 0
for i in times:
  res += (int(i)//10)*10+10
  
time = []
for j in times:
  time.append((int(j[-1]) if j[-1] != "0" else 10))
  
print(res - 10 + min(time))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
ans=0
A=[int(input()) for i in range(5)]
a=0
p=0
for i in range(5):
  if (A[i]%10)>a:
    p=i
    a=A[i]
for i in range(5):
  if i==p:
    ans+=A[i]
  else:
    ans+=10*(math.ceil(A[i]/10))
print(ans)

Submission status: Wrong Answer

Solution code:
import math
ans=0
A=[int(input()) for i in range(5)]
a=10
for i in range(5):
  if a>(A[i]%10):
    p=i
    a=A[i]
for i in range(5):
  if i==p:
    ans+=A[i]
  else:
    ans+=10*(math.ceil(A[i]/10))
print(ans)

Submission status: Wrong Answer

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

for i in range(5):
  if int(s[i]) % 10 == 0:
    x10 = x10 + 1
  else:
    pass
  sum = sum + ((int(s[i]) - 1) // 10 + 1) * 10
  a.append(int(s[i]) % 10)
  
b = [int(s) for s in a]

if x10 == 5:
  print(sum)
else:
  print(sum - 10 + min(b))

Submission status: Wrong Answer

Solution code:
import itertools
a=[]
for i in range(5):
    a.append(int(input()))
out=sum(a)*5
ls = list(itertools.permutations(range(5)))
for i in ls:
    t=0
    for j in i:
        if t%10 != 0:
            t+=10-t%10
        t+=a[j]
    if t <=out:
        out=t
print(out)

Submission status: Wrong Answer

Solution code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
nn = [a, b, c, d, e]
for i in nn:
    if i == a:
        chk = i%10
        last = i
    else:
        if chk > i%10:
            chk = i%10
            last = i
s = False
for i in nn:
    if s == False and i == last:
        ans += i
        s = True
    else:
        ans += i + (10 - i%10)
print(ans)

Submission status: Wrong Answer

Solution code:
import copy
T=[]
for i in range(5):
    T.append(int(input()))
t=[]
for i in range(5):
    t.append(T[i]%10)
a=0
if 0 not in t:
    for i in range(5):
        if t[i]!=min(t):
            a+=((T[i]//10)+1)*10
        if t[i]==min(t):
            a+=T[i]
if 0 in t:
    u=[i for i in t if i!=0]
    for i in range(5):
        if t[i]==0:
            a+=T[i]
        if t[i]!=0 and t[i]!=min(u):
            a+=((T[i]//10)+1)*10
        if t[i]!=0 and t[i]==min(u):
            a+=T[i]
print(a)

Submission status: Wrong Answer

Solution code:
sum=0
minb=124
for i in range(5):
    a=int(input())
    sum += a//10*10 if a%10==0 else a//10*10+10
    b=a%10
    minb = min(minb,b) if b!=0 else minb
print(sum-10+minb)

Submission status: Wrong Answer

Solution code:
sum=0
for i in range(5):
  A=int(input())
  s=((A//10)+1)*10
  #print(s)
  sum+=s
print(sum)

Submission status: Wrong Answer

Solution code:
import math
minutes = [int(input()) for _ in range(5)]
minutes = sorted(minutes,key = lambda x:-x%10)
cnt = 0
for i in minutes:
    cnt += math.ceil(i/10)*10
cnt -= 10 - minutes[-1] % 10
print(cnt)

Submission status: Wrong Answer

Solution code:
x,y=[],[]
t=10
for i in range(5):
    x.append(int(input()))
    y.append(x[i]%10)
    if 0<y[i]<t:
        t=y[i]
    if x[i]%10!=0:
        x[i]=((x[i]//10)+1)*10
    y[i]=x[i]

print(x)
print(y)
print(t)
print(sum(y)+t-10)

Submission status: Wrong Answer

Solution code:
K=[int(input()) for _ in range(5)]
ans=0
c=10
for i in range(5):
  c=min(K[i]%10,c)
for k in range(5):
  ans+=(K[k]//10)*10+10
print(ans-10+c)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
time=((a//10)+1)*10+((b//10)+1)*10+((c//10)+1)*10+((d//10)+1)*10+((e//10)+1)*10
muda=[]
muda.append(((a//10)+1)*10-a)
muda.append(((b//10)+1)*10-b)
muda.append(((c//10)+1)*10-c)
muda.append(((d//10)+1)*10-d)
muda.append(((e//10)+1)*10-e)
print(time-max(muda))

Submission status: Wrong Answer

Solution code:
# 10の余りの絶対値でソートできると良いのですが、今のところ検討中です。

Submission status: Wrong Answer

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

L.sort()

for i in range(5):
  L[i] += 10*(4-i)

print(max(L))

Submission status: Wrong Answer

Solution code:
import math
s = []
l = []

for i in range(5):
    d = int(input())
    t = math.ceil(d/10)
    s.append(t)
    l.append(t-d/10)
    
print(int(sum(s) - max(l))*10 )

Submission status: Wrong Answer

Solution code:
a=[]
b=[]
ori=[]
ans=0
for i in range(5):
  c=int(input())
  ori.append(c)
  a.append((c//10+1)*10)
  
  if c%10==0:
    b.append(100)
  else:
    b.append(c%10)
a.pop(b.index(min(b)))
print(ori[b.index(min(b))]+sum(a))

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict


def input():
    return sys.stdin.readline().rstrip()


def main():
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())

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

    d = 0
    p = []

    for i in range(5):
        x, y = divmod(W[i], 10)
        if y == 0:
            d += x
            p.append(y)
        else:
            d += x + 1
            p.append(y)

    print(d * 10 + min(p)-10)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

ans = a//10*10 + b//10*10 + c//10*10 + d//10*10 + e//10*10 + 50

for i in range(1, 10):
    for j in [a, b, c, d, e]:
        if str(j)[-1] == str(i):
            ans += i - 10
            print(ans)
            exit()
print(ans)

Submission status: Wrong Answer

Solution code:
list1 = []
for i in range(5):
  a = input()
  b = int(a[-1])
  c = int(a)
  list1.append((b,c))
aaa = sorted(list1)

mini = []
total = 0
for i in range(5):
  if aaa[i][0] != 0:
    mini = aaa[i]
    
    a = aaa.pop(i)
    break

for i in aaa:
  if i[0] != 0:
    d = 10 - i[0]
    ans = i[1] + d
  else:
    ans = i[1]
  total += ans
try:
  total += mini[1]
except:
  total = 0
print(total)

Submission status: Wrong Answer

Solution code:
n=[int(input()) for _ in range(5)]
try:
  m=10-min([i%10 for i in n if i%10!=0])
  n=[i if i%10==0 else i+(10-i%10) for i in n]
  print(sum(n)-m)
except:
  print(0)

Submission status: Wrong Answer

Solution code:
n=[int(input()) for _ in range(5)]
try:
  m=10-min([i%10 for i in n if i%10!=0])
  n=[i if i%10==0 else i+(10-i%10) for i in n]
  print(sum(n)-m)
except:
  print(50)

Submission status: Wrong Answer

Solution code:
n=[int(input()) for _ in range(5)]
try:
  m=10-min([i%10 for i in n if i%10!=0])
  n=[i if i%10==0 else i+(10-i%10) for i in n]
  print(sum(n)-m)
except:
  print(40)

Submission status: Wrong Answer

Solution code:
n=[int(input()) for _ in range(5)]
try:
  m=10-min([i%10 for i in n if i%10!=0])
  n=[i if i%10==0 else i+(10-i%10) for i in n]
  print(sum(n)-m)
except:
  print(60)

Submission status: Wrong Answer

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

L = list(map(int, read().decode("utf-8").split()))

last_ = L[0] % 10
last_index = 0
for i, t in enumerate(L):
    if 0 < t % 10 < last_:
        last_ = t % 10
        last_index = i

ans = 0
for i, t in enumerate(L):
    if i != last_index:
        ans += t
        if t % 10:
            ans += 10 - (t % 10)
        print(ans)
print(last_index)
ans += L[last_index]
print(ans)

Submission status: Wrong Answer

Solution code:
import math
nums = [int(input()) for _ in range(5)]
mn = float('inf')

for i in nums:
    if i%10!=0:
        mn = min(mn, i%10)
if mn == float('inf'):
    mn = 0

print(sum(list(map(lambda x: int(math.ceil(x/10)*10), nums)))-10+mn)

Submission status: Wrong Answer

Solution code:
import math
a=[]
first=[]
for i in range(5):
    temp=str(input())
    a.append(temp)
    first.append(int(temp[-1]))
nin=0
nva=9

for i in range(5):
    if first[i]!=0 and first[i]<nva:
        nin=i
        nva=first[i]

ans=0
for i in range(5):
    if i!=nin:
        temmp=int(a[i])
        temmp=math.ceil((temmp-0.5)/10)*10
        ans+=temmp
        print(temmp)
    else:
        ans+=int(a[i])
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a=[]
first=[]
for i in range(5):
    temp=str(input())
    a.append(temp)
    first.append(int(temp[-1]))
nin=0
nva=9
print(first)
for i in range(5):
    if first[i]!=0 and first[i]<nva:
        nin=i
        nva=first[i]
print(nin)

ans=0
for i in range(5):
    if i!=nin:
        temmp=int(a[i])
        temmp=math.ceil((temmp-0.5)/10)*10
        ans+=temmp
        print(temmp)
    else:
        ans+=int(a[i])
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

a_1 = int(a[-1])
b_1 = int(b[-1])
c_1 = int(c[-1])
d_1 = int(d[-1])
e_1 = int(e[-1])

m = min(a_1, b_1, c_1, d_1, e_1)
ans = 0

if a_1 == m:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(a)
elif b_1 == m:
    ans = math.ceil(int(a) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(b)
elif c_1 == m:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(a) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(c)
elif d_1 == m:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(a) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(d)
else:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(a) / 10) * 10 + int(e)

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

def roundup(n):
    return int(math.ceil(n /10)) * 10
def get_digit(number):
    return number % 10   
s = 0
m = []
li = [A, B, C, D, E]
for i in range(len(li)):
    if get_digit(li[i]) >= 1:
        m.append(get_digit(li[i]))
f = False
m.sort()        
for l in range(len(li)):
    if len(m) > 0:
        if m[0] == get_digit(li[l]) and f == False:
            s += li[l]
            f = True
        else:
            s += roundup(li[l])
            print(roundup(li[l]))
    else:
        s =sum(li)
print(s)

Submission status: Wrong Answer

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

lst1 = []
lst2 = []
for i in range(5):
    if T[i]%10 == 0:
        lst1.append([0,T[i]])
    else:
        lst2.append([T[i]%10,T[i]])

lst2 = sorted(lst2, reverse=True)
lst = lst1 + lst2

ans = 0
for i in range(5):
    ans += lst[i][1]
    if lst[i][0] == 0:
        pass
    else:
        ans += 10 - lst[i][0]

ans -= 10 - lst[i][0]

print(ans)

Submission status: Wrong Answer

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

lst1 = []
lst2 = []
for i in range(5):
    if T[i]%10 == 0:
        lst1.append([0,T[i]])
    else:
        lst2.append([T[i]%10,T[i]])

lst2 = sorted(lst2, reverse=True)
lst = lst1 + lst2
print(lst)

ans = 0
for i in range(5):
    ans += lst[i][1]
    if lst[i][0] == 0:
        pass
    else:
        ans += 10 - lst[i][0]

ans -= 10 - lst[i][0]

print(ans)

Submission status: Wrong Answer

Solution code:
T = [int(input()) for _ in range(5)]
T.sort(key=lambda x:x % 10 if x % 10 != 0 else 10)

ans = 0
ans += T[0]
for i in range(1,4):
  ans += T[i]
  if T[i] % 10 != 0:
    ans += 10 - T[i] % 10
print(ans)

Submission status: Wrong Answer

Solution code:
T = [int(input()) for _ in range(5)]
T.sort(key=lambda x:x % 10 if x % 10 != 0 else 10)

ans = 0
ans += T[0]
for i in range(1,4):
  ans += T[i] + (10 - T[i] % 10)
print(ans)

Submission status: Wrong Answer

Solution code:
short = 10
ans = 0
for i in range(5):
    n = int(input())
    if short > n%10 and n%10 > 0:
        short = n%10
    ans += (n//10)*10
    if n%10 > 0:
        ans += 10
print(short,ans)
ans -= 10 if short > 0 else 0
print(ans+short)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
array = [ int(input()) for I in range(5) ]
for I in array:
    if not ( 1 <= I <= 123 ):
        sys.exit()

min = (123 * 5) + (10 * 5)
for J in list(itertools.permutations(array)):
    time = 0
    for K in J[0:-1]:
        time += round(K,-1)
    time += J[-1]
    if min > time: min = time
print(min)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
 
rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7
 
li = [ri() for _ in range(5)]
lis = [math.ceil(i/10)*10 for i in li]
print(lis)
ans = inf
for i in range(5):
  ans = min(sum(lis[:i])+li[i]+sum(lis[i+1:]), ans)
print(ans)

Submission status: Wrong Answer

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

m = 9
ans = 0
for i in (a, b, c, d, e):
    q, mod = divmod(i, 10)
    if mod == 0:
        ans += i
    else:
        m = min(m, mod)
        ans += (q + 1) * 10
print(ans - 10 + m)

Submission status: Wrong Answer

Solution code:
import math
X = [int(input()) for _ in range(5)]
t = 0
m = 100
for x in X:
  t += (math.ceil(x/10))*10
  if x%10 != 0:
    m = min(m, x%10)
print(t+m-10 if m!=0 else t)

Submission status: Wrong Answer

Solution code:
l = [int(input()) for _ in range(5)]
m = [(x+9)//10*10 for x in l]
d = max([x - y for (x, y) in zip(l, m)])
print(sum(m)-d)

Submission status: Wrong Answer

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

new_list = []
for i in range(5):
    time = time_list[i]
    amari = 10 - int(str(time_list[i])[-1])
    new_list.append((time, amari))

new_list = sorted(new_list, key=lambda x: x[1])

total = 0
for i in range(4):
    total += new_list[i][0]
    total += new_list[i][1]

total += new_list[4][0]
print(total)

Submission status: Wrong Answer

Solution code:
def t(n):
  if n%10==0:
    return n
  else:
    return ((n//10)+1)*10
def k(n):
  if n%10==0:
    return 10
  else:
    return 10-(n%10)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
L=[k(a),k(b),k(c),k(d),k(e)]
print(t(a)+t(b)+t(c)+t(d)+t(e)-max(L))

Submission status: Wrong Answer

Solution code:
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

a=[]
r=[]
for i in range(5):
  s=ii()
  a.append(s)
  r_=s%10
  r.append(r_)
  
ans=0
while len(r)>1:
  k=r.index(max(r))
  remain=r.pop(k)
  A=a.pop(k)
  #print(A)
  ans+=A-remain+10
  
print(ans+a[0])

Submission status: Wrong Answer

Solution code:
import math
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
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
abcde=[a,b,c,d,e]
small=min(abcde)
abcde.sort()
while (small==0) & (len(abcde)!=0):
    try:
        del abcde[0]
        small=abcde[0]
    except:
        pass
print(A+B+C+D+E-(10-small))

Submission status: Wrong Answer

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

ans = 0
min_div = 10
for i in l:
  ans += 10 * (i + 10 - 1) //10
  if i % 10 != 0:
  	min_div = min(min_div, i % 10)
print(ans - (10 - min_div))

Submission status: Wrong Answer

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

ans = 0
min_div = 10
for i in l:
  ans += 10 * (i + 10 - 1) //10
  min_div = min(min_div, i % 10)
print(ans - (10 - min_div))

Submission status: Wrong Answer

Solution code:
A = []
m = 0
ans = 0
for i in range(5):
  a = int(input())
  if round(a+5, -1) - a > m:
    m = round(a+5, -1) - a
  ans += round(a+5,-1)
print(ans-m)

Submission status: Wrong Answer

Solution code:
import math
count = 0
amari = 9
for i in range(5):
  n = int(input())
  if n%10 == 0:
    count += n
  else:
    count += math.ceil(n/10)*10
    amari = min(amari,n%10)
if amari %10 == 0:
  print(count + amari) 
else:
  print(count + amari -10)

Submission status: Wrong Answer

Solution code:
import math
count = 0
amari = 9
for i in range(5):
  n = int(input())
  if n%10 == 0:
    count += n
  else:
    count += math.ceil(n/10)*10
    amari = min(amari,n%10)
print(count + amari - 10)

Submission status: Wrong Answer

Solution code:
import sys

a = int(sys.stdin.readline())
b = int(sys.stdin.readline())
c = int(sys.stdin.readline())
d = int(sys.stdin.readline())
e = int(sys.stdin.readline())

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

min_m = 10
for dish in dishes:
    diff = dish % 10
    if diff > 0:
        min_m = min(min_m, diff)

ans = 0
tmp = -1
for dish in dishes:
    diff = dish % 10
    if diff == min_m and tmp == -1:
        tmp = dish
    else:
        if diff:
            ans += dish + 10 - diff
        else:
            ans += dish

print(ans + tmp)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = A%10
if a>=5:
  a = 10-a
b = B%10
if b>=5:
  b = 10-b
c = C%10
if c>=5:
  c = 10-c
d = D%10
if d>=5:
  d = 10-d
e = E%10
if e>=5:
  e = 10-e

answer = min(A+B+b+C+c+D+d+E+e, A+a+B+C+c+D+d+E+e, A+a+B+b+C+D+d+E+e)
finalanswer = min(answer, A+a+B+b+C+c+D+E+e, A+a+B+b+C+c+D+d+E)
print(finalanswer)

Submission status: Wrong Answer

Solution code:
from math import ceil
a=[int(input()) for i in range(5)]
ans=9
for i in a:
  ans=min(ans,(i-1)%10+1)
map(lambda x:ceil(x/10)*10,a)
print(sum(a)-ans)

Submission status: Wrong Answer

Solution code:
import math
ans=0
for i in range(5):
    a=int(input())
    a*=0.1
    a=math.ceil(a)
    ans+=a*10
print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B,C,D,E = [int(input()) for _ in range(5)]
A1 = math.ceil(A/10) * 10
B1 = math.ceil(B/10) * 10
C1 = math.ceil(C/10) * 10
D1 = math.ceil(D/10) * 10
E1 = math.ceil(E/10) * 10
A2 = A % 10
B2 = B % 10
C2 = C % 10
D2 = D % 10
E2 = E % 10
for i in range(1,10):
    if A2 == i or B2 == i or C2 == i or D2 == i or E2 == i:
        print(A1+B1+C1+D1+E1-(10-i))
        break
    elif A2 == 0 and B2 == 0 and C2 == 0 and D2 == 0 and E2 == 0:
        print(A1+B1+C1+D1+E1)

Submission status: Wrong Answer

Solution code:
import math
A,B,C,D,E = [int(input()) for _ in range(5)]
A1 = math.ceil(A/10) * 10
B1 = math.ceil(B/10) * 10
C1 = math.ceil(C/10) * 10
D1 = math.ceil(D/10) * 10
E1 = math.ceil(E/10) * 10
A2 = A % 10
B2 = B % 10
C2 = C % 10
D2 = D % 10
E2 = E % 10
for i in range(1,10):
    if A2 == i or B2 == i or C2 == i or D2 == i or E2 == i:
        print(A1+B1+C1+D1+E1-(10-i))
        break
    if A2 == 0 and B2 == 0 and C2 == 0 and D2 == 0 and E2 == 0:
        print(A1+B1+C1+D1+E1)

Submission status: Wrong Answer

Solution code:
import math
A,B,C,D,E = [int(input()) for _ in range(5)]
A1 = math.ceil(A/10) * 10
B1 = math.ceil(B/10) * 10
C1 = math.ceil(C/10) * 10
D1 = math.ceil(D/10) * 10
E1 = math.ceil(E/10) * 10
A2 = A % 10
B2 = B % 10
C2 = C % 10
D2 = D % 10
E2 = E % 10
for i in range(1,10):
    if A2 == i or B2 == i or C2 == i or D2 == i or E2 == i:
        print(A1+B1+C1+D1+E1-(10-i))
        break
    else:
        print(A1+B1+C1+D1+E1)

Submission status: Wrong Answer

Solution code:
import math
A,B,C,D,E = [int(input()) for _ in range(5)]
A1 = math.ceil(A/10) * 10
B1 = math.ceil(B/10) * 10
C1 = math.ceil(C/10) * 10
D1 = math.ceil(D/10) * 10
E1 = math.ceil(E/10) * 10
A2 = A % 10
B2 = B % 10
C2 = C % 10
D2 = D % 10
E2 = E % 10
for i in range(1,11):
    if A2 == i or B2 == i or C2 == i or D2 == i or E2 == i:
        print(A1+B1+C1+D1+E1-(10-i))
        break

Submission status: Wrong Answer

Solution code:
import math
A,B,C,D,E = [int(input()) for _ in range(5)]
A1 = math.ceil(A/10) * 10
B1 = math.ceil(B/10) * 10
C1 = math.ceil(C/10) * 10
D1 = math.ceil(D/10) * 10
E1 = math.ceil(E/10) * 10
A2 = A % 10
B2 = B % 10
C2 = C % 10
D2 = D % 10
E2 = E % 10
for i in range(1,10):
    if A2 == i or B2 == i or C2 == i or D2 == i or E2 == i:
        print(A1+B1+C1+D1+E1-(10-i))
        break

Submission status: Wrong Answer

Solution code:
flag = False
mini = 124
time = 0
for _ in range(5):
    A = int(input())
    if A%10 == 0:
        time += A
    else:
        time += A - A%10 + 10
        mini = min(A%10, mini)
time += mini - 10
print(time)

Submission status: Wrong Answer

Solution code:
flag = False
mini = 124
time = 0
for _ in range(5):
    A = int(input())
    if A%10 == 0:
        time += A
    else:
        time += A - A%10 + 10
        mini = min(A%10, mini)
    print(time)
time += mini - 10
print(time)

Submission status: Wrong Answer

Solution code:
def ip():return int(input())
ans=0
m=9
for i in range(5):
    a=ip()
    if a%10>0:
        ans+=(a//10+1)*10
    else:ans+=a
    if a%10>0:m=min(m,a%10)
print(ans-(10-m))

Submission status: Wrong Answer

Solution code:
def ip():return int(input())
ans=0
m=9
for i in range(5):
    a=ip()
    ans+=a
    if ans%10!=0:ans=(ans//10+1)*10
    if a%10>0:m=min(m,a%10)
print(ans-(10-m))

Submission status: Wrong Answer

Solution code:
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]
m = min(s)
if a%10 == m:
    ans = a + int(b/10)*10+int(c/10)*10+int(d/10)*10+int(e/10)*10+40
elif b%10 == m:
    ans = b + int(a/10)*10+int(c/10)*10+int(d/10)*10+int(e/10)*10+40
elif c%10 == m:
    ans = c + int(b/10)*10+int(a/10)*10+int(d/10)*10+int(e/10)*10+40
elif d%10 == m:
    ans = d + int(b/10)*10+int(c/10)*10+int(a/10)*10+int(e/10)*10+40
else:
    ans = e + int(b/10)*10+int(c/10)*10+int(d/10)*10+int(a/10)*10+40
print(ans)

Submission status: Wrong Answer

Solution code:
from math import *

def comTime(x):
  return ceil(x/10) * 10

def solve(_l):
  s = 0
  l =sorted(_l, key=lambda x: x % 10)
  s += sum(map(comTime,l[1:])) + l[0]
  return s
  
_l = [int(input()) for _ in range(5)]
print(solve(_l))

Submission status: Wrong Answer

Solution code:
def comTime(x):
  return (x//10)*10 + 10

def solve(_l):
  s = 0
  l =sorted(_l, key=lambda x: x % 10)
  s += sum(map(comTime,l[1:])) + l[0]
  return s
  
_l = [int(input()) for _ in range(5)]
print(solve(_l))

Submission status: Wrong Answer

Solution code:
def comTime(x):
  return (x//10)*10 + 10

def solve(_l):
  s = 0
  l =sorted(_l, key=lambda x: x % 10 if x % 10 != 0 else 10)
  s += sum(map(comTime,l[1:])) + l[0]
  return s
  
_l = [int(input()) for _ in range(5)]
print(solve(_l))