Problem:


Score: 200 points

Problem Statement

The restaurant AtCoder serves the following five dishes:

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

ARC Curry: takes B minutes to serve.

AGC Pasta: takes C minutes to serve.

APC Ramen: takes D minutes to serve.

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

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

This restaurant has the following rules on orders:

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

Only one dish can be ordered at a time.

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

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

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

Constraints

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

Input

Input is given from Standard Input in the following format:

A
B
C
D
E

Output

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

Sample Input 1

29
20
7
35
120

Sample Output 1

215

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

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

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

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

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

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

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

Sample Input 2

101
86
119
108
57

Sample Output 2

481

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

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

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

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

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

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

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

Sample Input 3

123
123
123
123
123

Sample Output 3

643

This is the largest valid case.



Sample input:
29
20
7
35
120


Sample output:
215

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math

def ReadInputNum():
    input_num=[]
    for i in range(5):
        input_num.append(int(input()))
    return tuple(input_num)

def CheckRangeInput(*argv):
    for num in argv:
        if num<=123 and isinstance(num,int):
            pass
            # print("good")                                                                                                                                                              
        else:
            print("input"+ num +"is unexpected.")
            sys.exit()


def SumTotalTime(Tuple_Input):
    list_input=list(Tuple_Input)
    # print(list_input)                                                                                                                                                                  
    list_tmp=np.array(list_input)
    amari=(list_tmp-1)%10
    amari=amari.tolist()
    # print(amari)                                                                                                                                                                       
    last_one=min(amari)
    # print(last_one)                                                                                                                                                                    
    last_one=list_input.pop(amari.index(last_one))
    print(last_one)
    print(list_input)

    out_put=0
    for i in list_input:
        out_put += math.ceil(i/10)*10
    # print(out_put)                                                                                                                                                                     
    print(out_put+last_one)



A,B,C,D,E = ReadInputNum()
CheckRangeInput(A,B,C,D,E)
tuple_input = (A,B,C,D,E)
SumTotalTime(tuple_input)

Submission status: Wrong Answer

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


import sys
import numpy as np
import math

def ReadInputNum():
    input_num=[]
    for i in range(5):
        input_num.append(int(input()))
    return tuple(input_num)

def CheckRangeInput(*argv):
    for num in argv:
        if num<=123 and isinstance(num,int):
            pass
            # print("good")                                                                                                                                                              
        else:
            print("input"+ num +"is unexpected.")
            sys.exit()


def SumTotalTime(Tuple_Input):
    list_input=list(Tuple_Input)
    # print(list_input)                                                                                                                                                                  
    list_tmp=np.array(list_input)
    amari=(list_tmp-1)%10
    amari=amari.tolist()
    # print(amari)                                                                                                                                                                       
    last_one=min(amari)
    # print(last_one)                                                                                                                                                                    
    last_one=list_input.pop(amari.index(last_one))
    print(last_one)
    print(list_input)

    out_put=0
    for i in list_input:
        out_put += math.ceil(i/10)*10
    # print(out_put)                                                                                                                                                                     
    print(out_put+last_one)



A,B,C,D,E = ReadInputNum()
CheckRangeInput(A,B,C,D,E)
tuple_input = (A,B,C,D,E)
SumTotalTime(tuple_input)

Submission status: Wrong Answer

Solution code:
num = 0
l = [input() for i in range(5)]
for i, j in enumerate(l,0):
  if j[-1] == "0":
    num += int(j)
    l.pop(i)
l1 = [int(i) for i in l]
l2 = [10-int(str(i)[-1]) for i in l1]
a = l2.index(max(l2))
for i, j in enumerate(l1,0):
  if i != a:
    num += j+l2[i]
  else:
    num += j
print(num)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[8]:


import math
ds = [int(input()) for i in range(5)]
"""
29
20
7
35
120
"""


# In[9]:


s1 = [d%10 for d in ds if d%10!=0]
if s1:
    m1 = min(s1)
else:
    m1 = 0


# In[10]:


sum_ = 0
for d in ds:
    sum_ += math.ceil(d/10)*10


# In[11]:


print(sum_-10+m1)


# In[ ]:

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[1]:


ds = [int(input()) for i in range(5)]
"""
29
20
7
35
120
"""


# In[6]:


s1 = [d%10 for d in ds if d%10!=0]
if s1:
    m1 = min(s1)
else:
    m1 = 0


# In[ ]:


sum_ = 0
for d in ds:
    sum_


# In[7]:


bool([])


# In[ ]:

Submission status: Wrong Answer

Solution code:
M = [int(input()) for _ in range(5)]
N = []
n = []
T = 0
for i in range(5):
    N.append(M[i] % 10)
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        n.append(M[i] % 10)
for i in range(5):
    if max(N) > 0:
        print(T - (10 - min(n)))
        break
    else:
        print(T)

Submission status: Wrong Answer

Solution code:
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 > 0:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
        T -= min(m)
    else:
        T += M[i]
print(T)

Submission status: Wrong Answer

Solution code:
import math

sm = 0
dishes = []
for i in range(5):
    nm = int(input())
    if nm % 10 == 0:
        sm += nm
        continue
    dishes.append(nm)
last = min(dishes, key=(lambda x: x % 10), default=0)
for e in dishes:
    if e == last:
        continue
    sm += math.ceil(e / 10) * 10

print(sm + last)

Submission status: Wrong Answer

Solution code:
diff = 123
total = 0

for i in range(5) :
    time = int(input())
    if time % 10 > 0 :
        diff = min(diff,time % 10)
    total += int((time + 9) / 10) * 10

print(total - 10 + diff)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
mozi = [a, b, c, d, e]
rup = [round(mozi[i], -1) if mozi[i] % 10 == 0 else
       round(mozi[i] + 5, -1)
       for i in range(len(mozi))]

amari = [mozi[i] % 10 if mozi[i] % 10 != 0 else
         10 for i in range(len(mozi))]

m_r_a = list(zip(mozi, rup, amari))
sorta_m_r_a =(sorted(m_r_a, key=lambda x:x[2], reverse=True))
print(sorta_m_r_a)
dishes_4sum = 0
for i in range(4):
    dishes_4sum += sorta_m_r_a[i][1]
dishes_5sum = dishes_4sum + sorta_m_r_a[4][0]

print(dishes_5sum)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
mozi = [a, b, c, d, e]
rup = [round(mozi[i], -1) if mozi[i] % 10 == 0 else
       round(mozi[i] + 5, -1)
       for i in range(len(mozi))]

amari = [mozi[i] % 10 for i in range(len(mozi))]

m_r_a = list(zip(mozi, rup, amari))
sorta_m_r_a =(sorted(m_r_a, key=lambda x:x[2], reverse=True))
dishes_4sum = 0
for i in range(4):
    dishes_4sum += sorta_m_r_a[i][1]
dishes_5sum = dishes_4sum + sorta_m_r_a[4][0]

print(dishes_5sum)

Submission status: Wrong Answer

Solution code:
times = []
min_unit_place = 9
min_unit_index = None

for i in range(5):
  time_i = input()
  times.append(int(time_i))
  unit_place = int(time_i[-1])
  if unit_place > 0 and min_unit_place > unit_place:
    min_unit_place = unit_place
    min_unit_index = i
  
answer = 0
for i, t in enumerate(times):
  if i == min_unit_index or t%10 == 0:
    answer += t
  else:
    answer = answer + t + (10-t%10)

print(answer)

Submission status: Wrong Answer

Solution code:
order = []
amari = []
show = []
sum = 0
for i in range(5):
  order.append(int(input()))
  s = order[i] % 10
  if(s == 0):
    t = order[i]
  else:
    t = order[i] - s + 10
  amari.append(s)
  sum += t
ans = sum - 10 + min(amari)
print(ans)

Submission status: Wrong Answer

Solution code:
order = []
amari = []
show = []
sum = 0
for i in range(5):
  order.append(int(input()))
  s = order[i] % 10
  t = order[i] - s + 10
  amari.append(s)
  sum += t
ans = sum - 10 + min(amari)
print(ans)

Submission status: Wrong Answer

Solution code:
l=[]
for i in range(5):
  n=[]
  a=input()
  n.append(int(a[-1]))
  n.append(int(a))
  l.append(n)
t=0
for i in l:
  if i[0]==0:
    t=t+i[1]
    l.remove(i)
if len(l)>0:
  l.sort()
  t=t+int(l[0][1])
  l.remove(l[0])
if len(l)>0:
  for i in l:
    t=t+i[1]+10-i[0]
print(t)

Submission status: Wrong Answer

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

all_list = [A, B, C, D, E]
amari = [A%10, B%10, C%10, D%10, E%10]
amari = [ 10 if i == 0 else i for i in amari]
min_index = amari.index(min(amari))
amari = [ 0 if i == 10 else i for i in amari]
goukei = 0
for i, one in enumerate(all_list):
    if i != min_index:
        if one%10 > 0:
            goukei += one + (10-one%10)
        else:
            goukei += one
print(goukei)
goukei += all_list[min_index]
print(goukei)

Submission status: Wrong Answer

Solution code:
l=[]
for i in range(5):
  n=[]
  a=input()
  n.append(int(a[-1]))
  n.append(int(a))
  l.append(n)
t=0
for i in l:
  if i[0]==0:
    t=t+i[1]
    l.remove(i)
print(t)

Submission status: Wrong Answer

Solution code:
order = []
amari = []
show = []
for i in range(5):
  order.append(int(input()))
  s = order[i] % 10
  t = ((order[i] // 10) + 1) * 10
  amari.append(s)
  show.append(t)
ans = sum(show) - 10 + min(amari)
print(ans)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
All = [A, B, C, D, E]
late = 10
late_menu = 0
total = 0
for menu in All:
    if menu % 10 == 0:
        total += menu
        All.remove(menu)
#print(total)
for menu1 in All:
    if menu1 % 10 < late:
        late = menu1 % 10
        late_menu = menu1
All.remove(late_menu)
for x in All:
    if x < 10:
        x = 10
        total += x
    else:
        x = (x // 10 +1) * 10
        total += x
total = total + late_menu
print(total)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
All = [A, B, C, D, E]
late = 10
late_menu = 0
total = 0
for menu in All:
    if menu % 10 == 0:
        total += menu
        All.remove(menu)
#print(total)
for menu1 in All:
    if menu1 % 10 <= late:
        late = menu1 % 10
        late_menu = menu1
All.remove(late_menu)
for x in All:
    if x <= 10:
        x = 10
        total += x
    else:
        x = (x // 10 +1) * 10
        total += x
total = total + late_menu
print(total)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
All = [A, B, C, D, E]
late = 10
late_menu = 0
total = 0
for menu in All:
    if menu % 10 == 0:
        total += menu
        All.remove(menu)
for menu1 in All:
    if menu1 % 10 <= late:
        late = menu1 % 10
        late_menu = menu1
All.remove(late_menu)
for x in All:
    if x <= 10:
        x = 10
        total += x
    else:
        x = (x // 10 +1) * 10
        total += x
total = total + late_menu
print(total)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
import math
f=min([a%10,b%10,c%10,d%10,e%10])
v=math.ceil(a/10) * 10
w=math.ceil(b/10) * 10
x=math.ceil(c/10) * 10
y=math.ceil(d/10) * 10
z=math.ceil(e/10) * 10
print ('{0}'.format(v+w+x+y+z-10+f))

Submission status: Wrong Answer

Solution code:
a = [int(input()) for _ in range(5)]
def ceil(x):
  if x % 10 != 0:
    return 10 * ((x // 10) + 1)
  else:
    return x
sum = 0
min = float('inf')
for i in range(5):
  sum = sum + ceil(a[i])
  if a[i] % 10 != 0 and a[i] % 10 < min:
    min = a[i] % 10
print(sum - 10 + min)

Submission status: Wrong Answer

Solution code:
# B - Five Dishes

# n = []
n = [29, 20, 7, 35, 120]
# for _ in range(5):
#     n.append(int(input()))

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
# print(mini)
# print(mini_num)

# print(n.pop(mini_num))

time = n.pop(mini_num)
print(n)
for x in n:
    if x % 10 != 0:
        item = x + (10-x%10)
        time += item
    else:
        item = x
        time += item
#     print('item:', item)
#     print(time)
    
print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def tenth(a):
  temp = a
  while True:
    if temp % 10 == 0:
      return temp
    else:
      temp += 1

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

print(a + b + c + d + e)

Submission status: Wrong Answer

Solution code:
def main():
    a = [int(input()) for i in range(5)]
    a.sort(key=lambda x: x%10 if x%10 != 0 else 10, reverse=True)
    ans = 0
    for aa in a:
        if aa%10 != 0:
            ans += aa + (10 - aa%10)
        else:
            ans += aa
    print(ans-(10-aa%10))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9
count_change = 0

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):
        last_order = order_time[i]
        count_change += 1

if count_change == 0:
    last_order = order_time[i]

for i in range(0, order):
    if order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]

time -= last_order // 10 * 10 + 10
time += last_order

print(time)

Submission status: Wrong Answer

Solution code:
order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):
        last_order = order_time[i]
    else:
        last_order = order_time[i]

for i in range(0, order):
    if order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]

time -= last_order // 10 * 10 + 10
time += last_order

print(time)

Submission status: Wrong Answer

Solution code:
order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 < last_order % 10):
        last_order = order_time[i]

for i in range(0, order):
    if order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]
time -= last_order // 10 * 10 + 10
time += last_order

print(time)

Submission status: Wrong Answer

Solution code:

order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 < last_order % 10):
        last_order = order_time[i]

for i in range(0, order):
    if order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]
time -= last_order // 10 * 10 + 10
time += last_order

print(time)

Submission status: Wrong Answer

Solution code:
order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 < last_order % 10):
        last_order = order_time[i]

for i in range(0, order):
    if order_time[i] == last_order:
        continue
    elif order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]
time += last_order

print(time)

Submission status: Wrong Answer

Solution code:
order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 < last_order % 10):
        last_order = order_time[i]

for i in range(0, order):
    if (order_time[i] == last_order):
        continue
    elif(order_time[i] % 10 != 0):
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]
time += last_order

print(time)

Submission status: Wrong Answer

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

def make_ten(i):
    ans = 0
    while i % 10 != 0:
        i += 1
        ans += 1
    return [i,ans]

anslist = []
diflist = []
for i in range(5):
    anslist.append(make_ten(A[i])[0])
    diflist.append(make_ten(A[i])[1])

print(sum(anslist)-max(diflist) if max(diflist) != 0 else sum(anslist)-10)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
print(((A+9)//10)*10 + ((B+9)//10)*10 + ((C+9)//10)*10 + ((D+9)//10)*10 + ((E+9)//10)*10 + min(A%10, B%10, C%10, D%10, E%10) -10)

Submission status: Wrong Answer

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

print((A//10)*10 + (B//10)*10 + (C//10)*10 + (D//10)*10 + (E//10)*10 + min(A%10, B%10, C%10, D%10, E%10) -10)

Submission status: Wrong Answer

Solution code:
i = [int(input()) for i in range(5)]
min = i[4]
count = 0
for x in i:
    if 0 < x % 10 < min % 10:
        min = x
        count += 1
i.remove(min)

for x in i:
    if x % 10 != 0:
        index = i.index(x)
        x += 10 - x % 10
        i[index] = x

i.append(min)

print(sum(i))

Submission status: Wrong Answer

Solution code:
i = [int(input()) for i in range(5)]
min = 9
count = 0
for x in i:
    if 0 < x % 10 < min % 10:
        min = x
        count += 1
if count > 0:
    i.remove(min)

for x in i:
    if x % 10 != 0:
        index = i.index(x)
        x += 10 - x % 10
        i[index] = x

if count > 0:
    i.append(min)

print(sum(i))

Submission status: Wrong Answer

Solution code:
s = 0
mod = 0
for _ in range(5):
    i = int(input())
    m = i % 10
    if m != 0:
        if mod == 0:
            mod = m
        else:
            mod = min(mod, m)
        s += (i // 10 + 1) * 10
    else:
        s += i
s = s - 10 + mod

print(s)

Submission status: Wrong Answer

Solution code:
m = 9
f = 0
for _ in range(5):
    k = int(input())
    if k%10==0:
        f += k//10
    else:
        f += k//10+1
        if k%10<m:
            m = k%10
print(10*(f-1)+m)

Submission status: Wrong Answer

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
a1=a//10
a2=a%10
if a2==0:
    a1-=1
    a2=10
b1=b//10
b2=b%10
if b2==0:
    b1-=1
    b2=10
c1=c//10
c2=c%10
if c2==0:
    c1-=1
    c2=10
d1=d//10
d2=d%10
if d2==0:
    d1-=1
    d2=10
n=e//10
m=e%10
if m==0:
    n-=1
    m=10
min1=min(a2,b2,c2,d2,m)
if a2==10 or b2==10 or c2==10 or d2==10 or m==10:
    ans=(a1+b1+c1+d1+n+5)*10+min1
else:
    ans=(a1+b1+c1+d1+n+4)*10+min1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
a1=a//10
a2=a%10
if a2==0:
    a1-=1
b1=b//10
b2=b%10
if b2==0:
    b1-=1
c1=c//10
c2=c%10
if c2==0:
    c1-=1
d1=d//10
d2=d%10
if d2==0:
    d1-=1
n=e//10
m=e%10
if m==0:
    n-=1
min1=min(a2,b2,c2,d2,m)
if a2==0 or b2==0 or c2==0 or d2==0 or m==0:
    ans=(a1+b1+c1+d1+n+5)*10+min1
else:
    ans=(a1+b1+c1+d1+n+4)*10+min1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
a1=a//10
a2=a%10
if a2==0:
    a1-=1
b1=b//10
b2=b%10
if b2==0:
    b1-=1
c1=c//10
c2=c%10
if c2==0:
    c1-=1
d1=d//10
d2=d%10
if d2==0:
    d1-=1
n=e//10
m=e%10
if m==0:
    n-=1
min1=min(a2,b2,c2,d2,m)
if a1==0 or b1==0 or c1==0 or d1==0 or n==0:
    ans=(a1+b1+c1+d1+n+5)*10+min1
else:
    ans=(a1+b1+c1+d1+n+4)*10+min1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
a1=a//10
a2=a%10
b1=b//10
b2=b%10
c1=c//10
c2=c%10
d1=d//10
d2=d%10
e1=e//10
e2=e%10
min1=min(a2,b2,c2,d2,e2)
ans=(a1+b1+c1+d1+e1+4)*10+min1
print(ans)

Submission status: Wrong Answer

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

min = 9
num = 0
for i in range(len(A)):
    if min > A[i]%10 and A[i] % 10 != 0:
      min = A[i]%10
      num = i
      
ans = 0
for i in range(5):
  ans = ans + int((A[i]+9)/10) * 10
ans = ans + A[num] % 10 -10

print(ans)

Submission status: Wrong Answer

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

min = 9
num = 0
for i in range(len(A)):
    if min > A[i]%10 and A[i] % 10 != 0:
      min = A[i]%10
      num = i
      
ans = 0
for i in range(5):
  ans = ans + int((A[i]+9)/10) * 10
ans = ans + A[num] % 10

print(ans)

Submission status: Wrong Answer

Solution code:
t=0
for i in sorted(map(int,set(open(0))),key=lambda x:-x%10-(x%10<1)):t+=i+(10-t)%10
print(t)

Submission status: Wrong Answer

Solution code:
x =[int(input()) for _ in range(5)]
x_c = [round(xx + 5, -1) for xx in x]
x_f = [round(xx -5, -1) for xx in x]
diff = [a - b for a, b in zip(x_c, x)]
print(sum(x_c)-max(diff))

Submission status: Wrong Answer

Solution code:
def sub():
    items = [int(input()) for _ in range(5)]
    ms = [e % 10 for e in items]

    minIdx = None
    minMod = 11
    for i, m in enumerate(ms):
        if m == 0:
            continue
        if m < minMod:
            minMod = m
            minIdx = i
    if minIdx is None:
        print(sum(items))
        return
    others = items[:minIdx] + items[minIdx+1:]
    cum = 0
    for a in others:
        m = a % 10
        if m == 0:
            cum = cum + a
        else:
            cum = cum + (10 - m)
    cum = cum + items[minIdx]
    print(cum)

sub()

Submission status: Wrong Answer

Solution code:
import math

def sub():
    items = [int(input()) for _ in range(5)]
    cum = 0
    for a in items:
        if a % 10 == 0:
            cum = cum + a
        else:
            d = math.ceil(a / 10) * 10
            cum = cum + d
    print(cum)

sub()

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]
g = 0
sm = f[0]%10
for i in f:
    if i %10 == 0:
        g = g+ i
    else:
        g = g + 10*(i//10)+10
        if i%10 < sm:
            sm = i%10


print(sm+g-10)

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]
g = 0
sm = float('inf')
for i in f:
    if i %10 == 0:
        g = g+ i
    else:
        g = g + 10*(i//10)+10
        if i%10 < sm:
            sm = i%10


print(sm+g-10)

Submission status: Wrong Answer

Solution code:
import math
s = [int(input()) for i in range(5)]
ans = 0
minus = 9
for i in range(5):
    ans += math.ceil(s[i]/10)*10 

for i in range(5):
    if 1 <= s[i]%10 < minus:
        minus = s[i]%10
    else:
        continue
    


print(ans+minus-10)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
ans=(A//10+B//10+C//10+D//10+E//10+5)*10
ans=ans-9+min(A%10-1,B%10-1,C%10-1,D%10-1,E%10-1)
print(ans)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
ans=(A//10+B//10+C//10+D//10+E//10+5)*10
ans=ans-10+min(A%10-1,B%10-1,C%10-1,D%10-1,E%10-1)
print(ans)

Submission status: Wrong Answer

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

a = sum(list(map(lambda x: ((x-1)//10)*10+10, l)))

b = min(list(map(lambda x: (x-1)%10, l)))+1

print(a - b)

Submission status: Wrong Answer

Solution code:
import math

orders = [input() for i in range(5)]
orders_int = list(map(lambda x: int(x), orders))
orders_last_digit = list(map(lambda x: int(x[-1]), orders))
print(orders_int)
print(orders_last_digit)

last_order_index = 0

for i in range(len(orders_int)):
  if (orders_last_digit[i] == 0):
    continue
  if (orders_last_digit[last_order_index] > orders_last_digit[i]):
    last_order_index = i

print(orders_int[last_order_index])

last_order = orders_int.pop(last_order_index)

answer = 0

for item in orders_int:
  answer += math.ceil(item/10) * 10

answer += last_order
print(answer)

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,b,c,d,e]
totaltime = 0
longesttime = 100
for i in range(5):
    tmp = a[i] % 10
    if tmp == 0:
        tmp = 10
    if tmp < longesttime:
        longesttime = a[i] % 10
for i in range(5):
    totaltime += math.ceil(a[i] / 10) * 10
print(totaltime - (10 - longesttime))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a%10,b%10,c%10,d%10,e%10]
lst.sort()
cnt = 0
for i in range(len(lst)):
  if lst[i] == 0:
    cnt += 1
if cnt == 5:
  print(sum(lst)*10)
else:
  print((a//10+b//10+c//10+d//10+e//10+4-cnt)*10+lst[cnt])

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a%10,b%10,c%10,d%10,e%10]
lst.sort()
cnt = 0
for i in range(len(lst)):
  if lst[i] == 0:
    cnt += 1
if cnt == 5:
  print(sum(lst))
else:
  print((a//10+b//10+c//10+d//10+e//10+4-cnt)*10+lst[cnt])

Submission status: Wrong Answer

Solution code:
As = []
for i in range(5):
    x = int(input())
    time_b = (x//10 + 1)*10
    amari  = time_b%10
    As.append((amari, x, time_b))

As = sorted(As, key=lambda x:x[0])

sumed = sum([x[2] for x in As[1:]])

print(sumed + As[0][1])

Submission status: Wrong Answer

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

sorted(n, key=lambda x: x % 10)

for i in range(1, 5):
    n[i] = 10 * (n[i]//10+1)

sm = sum(n)
print(sm)

Submission status: Wrong Answer

Solution code:
list = []
timelist=[]
min_time = 9
for i in range(5):
    list.append(int(input()))
for i in list:
    if i%10 == 0:
        timelist.append(i)
    else:
        timelist.append((10-(i%10))+i)
        if i%10 < min_time:
            min_time = i%10
print(sum(timelist)-10+min_time)

Submission status: Wrong Answer

Solution code:
A = []
for _ in range(5):
    A.append(int(input()))
ans = sum([-10 * (-i//10) for i in A])
ans -= min([(10 - (i % 10)) % 10 for i in A])
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst_1 = sorted([(a - 1) % 10, (b - 1) % 10, (c - 1) % 10, (d - 1) % 10, (e - 1) % 10])
print(lst_1[0])
print(((a+9)//10)*10 + ((b+9)//10)*10 + ((c+9)//10)*10 + ((d+9)//10)*10 + ((e+9)//10)*10 - (10 - (lst_1[0] + 1) if lst_1[0] != 9 else 0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = []
for _ in range(5):
    A.append(int(input()))
ans = sum(A)
mod = [i % 10 for i in A]
ans = ans - 10 + min(mod)
print(ans)

Submission status: Wrong Answer

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

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

min_num = 10000
sum_num = sum(cooking)
for i in range(5):
    tmp = cooking[i]%10
    if tmp != 0:
        min_num = min(min_num, tmp)
        sum_num += 10-tmp

print(sum_num-(10-min_num))

Submission status: Wrong Answer

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

a1 = (a + 9) // 10 * 10
b1 = (b + 9) // 10 * 10
c1 = (c + 9) // 10 * 10
d1 = (d + 9) // 10 * 10
e1 = (e + 9) // 10 * 10

print(a1, b1, c1, d1, e1)

Submission status: Wrong Answer

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

a1 = (a + 9) // 10 * 10
b1 = (b + 9) // 10 * 10
c1 = (c + 9) // 10 * 10
d1 = (d + 9) // 10 * 10
e1 = (e + 9) // 10 * 10

print(a1 + b1 + c1 + d1 + e1)

Submission status: Wrong Answer

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

a1 = (a + 9) // 10 * 10
b1 = (a + 9) // 10 * 10
c1 = (a + 9) // 10 * 10
d1 = (a + 9) // 10 * 10
e1 = (a + 9) // 10 * 10

tmax = 0
if tmax < a1 - a:
	tmax = a1 - a
if tmax < b1 - b:
	tmax = b1 - b
if tmax < c1 - c:
	tmax = c1 - c
if tmax < d1 - d:
	tmax = d1 - d
if tmax < e1 - e:
	tmax = e1 - e

print(a1+b1+c1+d1+e1-tmax)

Submission status: Wrong Answer

Solution code:
s = 0
num = 0
for i in range(5):
  k = int(input())
  l = k - 10*int(k/10)
  if l>num:
    num = l
  if l==0:
    l=10
  s+=k-l+10
print(s-10+num)