Problem: 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.

Submission attempts (in order):
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)


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)


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)


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)


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)
    ans=(a1+b1+c1+d1+n+4)*10+min1
print(ans)


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)


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)
ans=(a1+b1+c1+d1+n+4)*10+min1
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted