Problem:


﻿Score: 100 points

Problem Statement

In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.

Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.

Determine if there exists a pair of antennas that cannot communicate directly.

Here, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.  

Constraints

a, b, c, d, e and k are integers between 0 and 123 (inclusive).

a < b < c < d < e

Input

Input is given from Standard Input in the following format:

a
b
c
d
e
k

Output

Print :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.

Sample Input 1

1
2
4
8
9
15

Sample Output 1

Yay!

In this case, there is no pair of antennas that cannot communicate directly, because:

the distance between A and B is 2 - 1 = 1

the distance between A and C is 4 - 1 = 3

the distance between A and D is 8 - 1 = 7

the distance between A and E is 9 - 1 = 8

the distance between B and C is 4 - 2 = 2

the distance between B and D is 8 - 2 = 6

the distance between B and E is 9 - 2 = 7

the distance between C and D is 8 - 4 = 4

the distance between C and E is 9 - 4 = 5

the distance between D and E is 9 - 8 = 1

and none of them is greater than 15. Thus, the correct output is Yay!.

Sample Input 2

15
18
26
35
36
18

Sample Output 2

:(

In this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.
Thus, the correct output is :(.



Sample input:
1
2
4
8
9
15


Sample output:
Yay!

Submission status: Wrong Answer

Solution code:
a=[int(input()) for i in range(5)]
k=int(input())
ans=0
for i in range(4):
  for j in range(i,4):
    if a[j]-a[i]>k:
      ans=":("
      break
if ans==0:
  print("Yay!")
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
try:
  a = int(input())
  b = int(input())
  c = int(input())
  d = int(input())
  e = int(input())
  k = int(input())
except EOFError:
   pass


s = [a,b,c,d,e]
kk ='';
for z in range(len(s)):
  ss = s[(z+1):]
  tx = s[z]
  for y in ss:
    if (tx - y) <= k :
      kk='Yay!'
    else:
      kk=':(' 
      
print(kk)

Submission status: Wrong Answer

Solution code:
a=[int(input()) for i in range(5)]
k=int(input())
ans=0
for i in range(4):
  for j in range(4-i):
    if a[j]-a[i]>k:
      ans=":("
      break
if ans==0:
  print("Yay!")
else:
  print(ans)

Submission status: Wrong Answer

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

ab = b-a
ac = c-a
ad = d-a
bc = c-b
bd = d-b
be = e-b
cd = d-c
ce = e-c
de = e-d

if ab <= k and ac <= k and ad <= k and bc <= k and bd <= k and be <= k and cd <= k and ce <= k and de <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
s = [a,b,c,d,e]
kk = "Yay!"
for z in range(len(s)):
  ss = s[(z+1):]
  tx = s[z]
  for y in ss:
    if (tx - y) <= k :
      kk="Yay!"
    else:
      kk=":("   
      
print(kk)

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = int(e)
k = int(k)
if 0 <= a and b and c and d and e and k <=123 :
    if a < b < c < d < e:
        lis = [e,d,c,b,a] 
        lis2 = [e,d,c,b,a] 
        for lisx in lis :
            lis2.remove( lisx )
            for lisx2 in lis2 :
                lisx = int(lisx)
                lisx2 = int(lisx2)
                mainasu = lisx - lisx2
                mainasu = int(mainasu)                                                                     
if mainasu > k :
    print(":(")                          
elif mainasu <= k:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
a = 0
b = 0
c = 0
d = 0
e = 0
k = 0
x = 0
y = 0

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



for i in range(5):

    for j in range(i+1, 5):
        result = antena[j] - antena[i]
        

        if result > k:
            x += 1


        else:
            y += 1
            


if x >= 1 and y < 10:
    print(":(")

elif x == 0 and y == 10:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
s = [a,b,c,d,e]
kk = "Yay!"
for z in range(len(s)):
  ss = s[(z+1):]
  tx = s[z]
  for y in ss:
    if (tx - y) < k :
      kk="Yay!"
    else:
      kk=":("   
      
print(kk)

Submission status: Wrong Answer

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

bar = inputs[:-1]
n = 5
k = inputs[-1]

ok = True

for i in range(n):
    for j in range(n):
        # print("i: {}, j:{}".format(i,j))
        if abs(bar[i] - bar[j]) > k:
            ok = False
            break
            

if ok:
    print("Yay!")
else:
    print(":)")

Submission status: Wrong Answer

Solution code:
a = 0
b = 0
c = 0
d = 0
e = 0
k = 0
x = 0
y = 0

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



for i in range(5):

    for j in range(i+1, 5):
        result = antena[j] - antena[i]
        print(result)

        if result > k:
            x += 1


        else:
            y += 1
            


if x >= 1 and y < 10:
    print(":(")

elif x == 0 and y == 10:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
s = [a,b,c,d,e]
kk = "Yay!"
for z in range(len(s)):
  ss = s[(z+1):]
  tx = s[z]
  for y in ss:
    if (tx - y) > k :
      kk=":("
      
print(kk)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
s=abs(a-b)
t=abs(b-c)
u=abs(c-d)
v=abs(e-d)
if s<=k and t<=k and u<=k and v<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
 
number1 = [a, b, c, d, e]
number2 = [b, c, d, e]
 
 
for num1 in number1:
  for num2 in number2:
    if abs(num1 - num2) <= k:
      print('Yay!')
    else:
      print(':(')

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
s=abs(a-b)
t=abs(b-c)
u=abs(c-d)
v=abs(e-d)
if s<=k or t<=k or u<=k or v<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Wrong Answer

Solution code:
ls = []
for i in range(5):
  ls.append(int(input()))
k = int(input())
a = []
for i in range(5):
  for j in range(i+1, 5):
    a.append(abs(ls[i] - ls[j]) < k)
if all(a):
  print('Yay!')
else:
  print(':(')

Submission status: Wrong Answer

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


for num1 in number1:
  for num2 in number2:
    if abs(num1 - num2) <= k:
      print('Yay!')
    else:
      print(':(')

Submission status: Wrong Answer

Solution code:
import math
n = [int(input()) for i in range(5)]
temp = 9
answer = 0
for i in n:
  last_dig = i % 10
  if last_dig <= temp:
    temp = last_dig
  answer += math.ceil(i/10)*10
print(answer - 10 + temp)

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
if int(e) - int(a) >= int(k):
  print(':(')
else:
  print('Yay')

Submission status: Wrong Answer

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

if k < abs(e-d) or k < abs(d-c) or k < abs(c-b) or k < abs(b-a):
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 21:07:41 2019

@author: qqwx2_000
"""
import itertools

ant_li=['A','B','C','D','E']
coordinate = []
distance = []
for i in ant_li:
    
    i = int(input(i+"の座標を入力して下さい: "))
    coordinate.append(i)
k=int(input('kを入力してください:'))

for i in itertools.combinations(coordinate, r=2):
    com = i
    d = com[1] - com[0]
    distance.append(d)
k_up = [i for i in distance if k < i]

if len(k_up) >= 1: 
    print(':(')
else:
    print('Yay!')

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
if int(e) - int(a) > int(k):
  print(':(')
else:
  print('Yay')

Submission status: Wrong Answer

Solution code:
print(':(')

Submission status: Wrong Answer

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

if k < e-d or k < d-c or k < c-b or k < b-a:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

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

ab = b-a
ac = c-a
ad = d-a
bc = c-b
bd = d-b
be = e-b
cd = d-c
ce = e-c
de = e-d

if ab <= 15 and ac <= 15 and ad <= 15 and bc <= 15 and bd <= 15 and be <= 15 and cd <= 15 and ce <= 15 and de <= 15:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

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

bar = inputs[:-1]
n = 5
k = inputs[-1]

ok = True

for i in range(n):
    for j in range(i,n):
        # print("i: {}, j:{}".format(i,j))
        if abs(bar[i] - bar[n-1-j]) > k:
            ok = False
            break

if ok:
    print("Yay!")
else:
    print(":)")

Submission status: Wrong Answer

Solution code:
a = 0
b = 0
c = 0
d = 0
e = 0
k = 0
x = 0
y = 0

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



for i in range(5):

    for j in range(i+1, 5):
        result = antena[j] - antena[i]
        

        if result > k:
            x += 1


        else:
            y += 1


if x == 10 and y == 0:
    print(":(")

elif y >= 1:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
l = list(map(int,input().split()))
k = int(input())
max = max(l)
min = min(l)
if max - min <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [e, d, c, b, a]
de = e - d
ce = e - c
cd = d - c
be = e - b
bd = d - b
bc = c - b
ae = e - a
ad = d - a
ac = c - a
ab = b - a
distance = [ab, ac, ad, ae, bc, bd,be, cd, ce, de]
output = []
ok = 'Yay!'
bad = ':('
for i in distance:
    if i >= k:
        output.append(bad)
    elif i < k:
        output.append(ok)
if bad in output:
    print(bad)
elif ok in output:
    print(ok)

Submission status: Wrong Answer

Solution code:
T = []
for i in range(6):
    T.append(int(input()))
if max(T)-min(T)<=15:
	print('Yay!')
else:
	print(':(')

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
if a==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,c,d,e))
elif b==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(a,c,d,e))
elif c==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,a,d,e)) 
elif d==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,a,c,e)) 
elif e==0 :
    print(A+B+C+D+E+30-a-b-c-d-e+min(b,a,d,c)) 
else :
    print(A+B+C+D+E+40-a-b-c-d-e+min(b,a,d,e,c))

Submission status: Wrong Answer

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

if e - d > k:
  print(':(')
elif d - c > k:
   print(':(')
elif c - b > k: 
  print(':(')
elif b - a > k:
  print(':(')
else:
  print('Yay!')

Submission status: Wrong Answer

Solution code:
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
result = 0
for i in range(len(data)):
    if data[i][0] < data[i][1]:
        if data[i][1] - data[i][0] < k:
            result +=1
    else:
        if data[i][0] - data[i][1] < k:
            result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
print(data)
result = 0
for i in range(len(data)):
    if data[i][0] < data[i][1]:
        if data[i][1] - data[i][0] < k:
            result +=1
    else:
        if data[i][0] - data[i][1] < k:
            result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
li = input().splitlines()
t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) >= int(s):
            t = 1
        elif int(i) - int(k) >= int(s):
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

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

if e - a > k:
  print(':(')
else:
  print('Yay')

Submission status: Wrong Answer

Solution code:
li = input().split()
t = 0
s = li.pop()
print(li)
for i in li:
    for k in li:
        if int(k) - int(i) >= int(s):
            t = 1
        elif int(i) - int(k) >= int(s):
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

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

if e-a<k:
  print("Yay!")
else:
  print(":(")

Submission status: Wrong Answer

Solution code:
x = [int(input()) for i in range(6)]
if x[4] - x[0] < x[-1]: print("Yay!")
else: print(":(")

Submission status: Wrong Answer

Solution code:
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
print(data)
result = 0
for i in range(len(data)):
    if data[i][0] < data[i][1]:
        if data[i][1] - data[i][0] < k:
            result +=1
    else:
        if data[i][0] - data[i][1] < k:
            result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

import itertools

def main():
    anthenas = []
    for _ in range(5):
        anthenas.append(int(input()))
    k = int(input())

    for v in  itertools.combinations(anthenas, 2):
        d = abs(v[1] - v[0])
        if d <= k:
            msg = ':('
            break
        msg = 'Yay!'
    
    print(msg)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 21:22:08 2019

@author: Tabe
"""

pos = list()
for i in range(5):
    pos.append(int(input()))

k = int(input())
hh = False

for index, val in  enumerate(pos):
    if hh == True:
        break;
    
    if index == 4:
        print("Yay!")
        break
    
    for i in  range(5):
        if abs(pos[index] - pos[i]) < k:
            pass
        else:
            print(":(")
            hh = True
            break
    else:
        print(":(")
        break

Submission status: Wrong Answer

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

if e - a > k:
  print('Yay')
else:
  print(':(')

Submission status: Wrong Answer

Solution code:
raw = raw_input()
a = int(raw)
raw = raw_input()                                  
b = int(raw)
raw = raw_input()                                  
c = int(raw)
raw = raw_input()                                  
d = int(raw)
raw = raw_input()                                  
e = int(raw)
raw = raw_input()                                  
k = int(raw)
                                                                                                       
if b - a > k or c - b > k or d - c > k or d - e > k:
    print ':('
else:                                                                                                  
    print 'Yay!'

Submission status: Wrong Answer

Solution code:
import math

a = list(map(int, [input() for i in range(5)]))
b = [math.ceil(b / 10) * 10 for b in a]

c1 = b[0] + b[1] + b[2] + b[3] + a[4]
c2 = b[0] + b[1] + b[2] + a[3] + b[4]
c3 = b[0] + b[1] + a[2] + b[3] + b[4]
c4 = b[0] + a[1] + b[2] + b[3] + b[4]
c5 = a[0] + b[1] + b[2] + b[3] + b[4]

print(min([c1, c2, c3, c4, c5]))

Submission status: Wrong Answer

Solution code:
l=[]
f=1
for i in range(5):
    a = int(input())
    l.append(a)
k = int(input())
a=0
for i in range(5):
    for j in range(5):
        if abs(l[i]-l[j])<k:
            continue
        else:
            a=1
            print(":(")
            break
    if a==0:
        continue
    else:
        break
if a != 1:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = int(e)
k = int(k)
if 0 <= a <=123 :
    if 0 <= b <=123 :
        if 0 <= c <=123 :
            if 0 <= d <=123 :
                if 0 <= e <=123 :
                    if 0 <= k <=123 :
                        if a < b < c < d < e:
                            lis = [e,d,c,b,a] 
                            lis2 = [e,d,c,b,a] 
                            for lisx in lis :
                                lis2.remove( lisx )
                                for lisx2 in lis2 :
                                    lisx = int(lisx)
                                    lisx2 = int(lisx2)
                                    mainasu = lisx - lisx2
                                    mainasu = int(mainasu)
if mainasu > k :
    print(":(")                          
elif mainasu <= k:
    print("Yay!")

Submission status: Wrong Answer

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

if abs(a-e) > k:
    print(":(")
else:
    print("Yey!")

Submission status: Wrong Answer

Solution code:
t = [0] * 5
t[0] = int(input())
t[1] = int(input())
t[2] = int(input())
t[3] = int(input())
t[4] = int(input())
k = int(input())

def check():
    for i in range(5):
        for j in range(i+1, 5-(i+1)):
            if t[j] - t[i] > k:
                return ':('
    return 'Yay!'

print(check())

Submission status: Wrong Answer

Solution code:
box=[]
for i in range(6):
  box.append(int(input()))
flag=0
for i in range(4):
  if (box[i]-box[i+1]) > box[5]:
    flag = 1#直接通信ができない
    break
if flag==1:
  print(':(')
else:
  print('Yay!')

Submission status: Wrong Answer

Solution code:
dish=[int(input()) for i in range(5)]
remain=[(dish[i]-1)%10 for i in range(5)]
divide=[(dish[i]-1)//10+1 for i in range(5)]
a=sorted(remain)[0]
print(sum(divide)*10-9+a)

Submission status: Wrong Answer

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

if abs(a-e) > k:
    print(":(")
else:
    print("Yey")

Submission status: Wrong Answer

Solution code:
raw = raw_input()
a = int(raw)
raw = raw_input()                                  
b = int(raw)
raw = raw_input()                                  
c = int(raw)
raw = raw_input()                                  
d = int(raw)
raw = raw_input()                                  
e = int(raw)
raw = raw_input()                                  
k = int(raw)
                                                                                                       
if b - a <= k or c - b <= k or d - c <= k or d - e <= k:                                               
    print 'Yay!'                                                                                       
else:                                                                                                  
    print ':('

Submission status: Wrong Answer

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

for i in range(4):
  for j in range(i+1, 5):
    if a[j] - a[i] > k:
      print(":(")
else :
  print("Yay!")

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
list1=[A,B,C,D,E]
sum=0
for item in list1:
  if(item%10==0):
    sum+=item
  else:
    sum=sum+item+(10-item%10)
print(sum)

Submission status: Wrong Answer

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

if b-a <= k and c-b <= k and d-c <= k and e-d <=k:
  print('Yay!')
else:
  print(':(')

Submission status: Wrong Answer

Solution code:
x = [int(input()) for i in range(5)]
if x[4] - x[0] < x[-1]: print("Yay!")
else: print(":(")

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ls=[a,b,c,d,e]
for i in range(len(ls)):
    for j in range(len(ls)-i):
        if ls[i] - ls[j] >= k:
            print(':(')
            break
    else:
        continue
    break
else:
    print('Yay!')

Submission status: Wrong Answer

Solution code:
m_list = list()
for k in range(5):
    m = int(input())
    m_list.append(m)
num = int(input())

x_list = list()
count = 0
for i in range(0, len(m_list)-1):
    for j in range(i+1, len(m_list)):
        x_list.append(m_list[j] - m_list[i])

print(x_list)
for a in range(len(x_list)):
    if x_list[a] >= num:
        count += 1

if count >= 1:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if b - a <= k and c - a <= k and d - a <= k and e - a <= k and c-b <= k and d-b <= k and e-b <= k and d-c <= k and e-c <= k and e - d <= k:
    print("Yay!")
else:
    print(": (")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

import itertools

def main():
    anthenas = []
    for _ in range(5):
        anthenas.append(int(input()))
    k = int(input())

    for v in  itertools.permutations(anthenas, 2):
        d = abs(v[1] - v[0])
        if d <= k:
            msg = ':('
            break
        msg = 'Yay!'
    
    print(msg)

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())
k = int(input())


lis = [e,d,c,b,a]
lis2 = [a,b,c,d,e]

yay_flg = 0

for x in lis:
  for j in lis2:
    if x - j <= k:
      yay_flg = 1
      
if yay_flg == 1:
  print("Yay!")
  
else:
  print(":(")

Submission status: Wrong Answer

Solution code:
num = []
for _ in range(6):
    num.append(int(input()))
#print(num)
f = 0
for i in range(5):
    if(num[i]-num[0]>=num[5]):
        f = 1
for i in range(2,5):
    if(num[i]-num[1]>=num[5]):
        f = 1

for i in range(3,5):
    if(num[i]-num[1]>=num[5]):
        f = 1

for i in range(4,5):
    if(num[i]-num[1]>=num[5]):
        f = 1

if(f == 0):
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
b=min(a)
if b<n:
    print(n//b+(n%b>0)-1+5)
else:
    print(5)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
list1=[A,B,C,D,E]
sum=0
for item in list1:
  if(item%10==0):
    sum+=item
  else:
    sum=sum+(10-item%10)
print(sum)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if (b-a)<k and (c-a)<k and (d-a)<k and (e-a)<k and (c-b)<k and (d-b)<k and (e-b)<k and (d-c)<k and (e-c)<k and (e-d)<k:
  print("Yay!")
else:
  print(":(")

Submission status: Wrong Answer

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


lis = [e,d,c,b,a]
lis2 = [a,b,c,d,e]

yay_flg = 0

for x in lis:
  for j in lis2:
    if x == j:
      break
    
    if x - j <= k:
      yay_flg = 1
      
if yay_flg == 1:
  print("Yay!")
  
else:
  print(":(")

Submission status: Wrong Answer

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

if a-b>k:
  print(':(')
elif b-c>k:
  print(':(')
elif c-d>k:
  print(':(')
elif d-e>k:
  print(':(')
elif a-e<k:
  print('Yay')

Submission status: Wrong Answer

Solution code:
# coding=utf-8

# write code...

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

if b-a>=k or c-a>=k or d-a>=k or e-a>=k or c-b>=k or d-b>=k or e-b>=k or d-c>=k or e-c>=k or e-d>=k:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

a = []
for i in range(6):
    a.append(int(input()))

# print(a)

flg = False

for i in range(5):
    # print("i ", i)
    
    for j in range(i + 1, 5):
        # print("j ", j)
        an = a[j] - a[i]
        # print("an ", an)
        if an < a[5]:
            flg = False
        else:
            flg = True
            break
    
    if flg:
        break
    
if flg:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

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

for i in range(4):
  for j in range(i, 5):
    if  j - i > k:
      print(":(")
else :
  print("Yay!")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

import itertools

def main():
    anthenas = []
    for _ in range(5):
        anthenas.append(int(input()))
    k = int(input())

    print(itertools.permutations(anthenas, 2))
    for v in  itertools.permutations(anthenas, 2):
        d = abs(v[1] - v[0])
        if d <= k:
            msg = ':('
            break
        msg = 'Yay!'
    
    print(msg)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=[]
for _ in range(6): n+=[int(input())]
print([":(","Yey"][n[4]-n[0]<=n[5]])

Submission status: Wrong Answer

Solution code:
import sys
max = -1
min = 124
a = list()
try:
    for line in map(int, sys.stdin):
        a.append(line)
except:
    pass

for i in range(0, len(a) - 1):
    if max < a[i]:
        max = a[i]
    if min > a[i]:
        min = a[i]

if max - 1 < a[-1]:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

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

print("Yay!" if e - a < k else ":(")

Submission status: Wrong Answer

Solution code:
import math
n = [int(input()) for i in range(6)]
temp = 9
answer = 0
for i in n:
  last_dig = i % 10
  if last_dig < temp:
    temp = last_dig
  answer += math.ceil(i/10)*10
print(answer - 10 + temp)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ls=[a,b,c,d,e]
for i in range(len(ls)):
    for j in range(len(ls)-i):
        if ls[i] - ls[j] >= k:
            print(':(')
            break
        else:
            continue
    break
else:
    print('Yay!')

Submission status: Wrong Answer

Solution code:
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
print(len(data))
result = 0
for i in range(len(data)):
    if data[i][0] - data[i][1] <= k:
        result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 21:22:08 2019

@author: Tabe
"""

pos = list()
for i in range(5):
    pos.append(int(input()))

k = int(input())


for index, val in  enumerate(pos):
    if index == 4:
        print("Yay!")
        break
    
    if val < pos[index + 1]:
        if (pos[index + 1] - val) < k:
            pass
        else:
            print(":(")
    else:
        print(":(")
        break

Submission status: Wrong Answer

Solution code:
import numpy as np

dish_min = []
 
for i in range(5):
   dish_min.append(int(input()))
    
p = [i%10 for i in dish_min]
pp = [(i-1)%10 for i in dish_min]
x = np.argmin(pp)

for i in range(5):
  if i != x and p[i]:
  	dish_min[i] += (10 - p[i])

print(sum(dish_min))

Submission status: Wrong Answer

Solution code:
import numpy as np

dish_min = []
 
for i in range(5):
   dish_min.append(int(input()))
    
p = [i%10 for i in dish_min]
pp = [(i-1)%10 for i in dish_min]
x = np.argmin(pp)

for i in range(5):
  if i != x and p[i]:
  	dish_min[i] += (10 - p[i])
print(dish_min)
print(sum(dish_min))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if abs(a-b)<k and abs(a-c)<k and abs(a-d)<k and abs(a-e)<k and abs(b-c)<k and abs(b-d)<k and abs(b-e)<k and abs(c-d)<k and abs(c-e)<k and abs(d-e)<k:
  print("Yay!")
else:
  print(":(")

Submission status: Wrong Answer

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

pools = [a, b, c, d, e]
ans = "Yay!"
if(max(pools) > k):
    ans = ":("
print(ans)

Submission status: Wrong Answer

Solution code:
pos = list()
for i in range(5):
    pos.append(int(input()))

k = int(input())


for index, val in  enumerate(pos):
    if index == 4:
        print("Yay!")
        break
    
    if val < pos[index + 1]:
        pass
    else:
        print(":(")
        break

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
antena = []

antena.append(abs(a-b))
antena.append(abs(a-c))
antena.append(abs(a-d))
antena.append(abs(a-e))
antena.append(abs(b-c))
antena.append(abs(b-d))
antena.append(abs(b-e))
antena.append(abs(c-d))
antena.append(abs(c-e))
antena.append(abs(d-e))

for i in antena:
    if i >= k:
        print(":(")
        break
    if i <= k:
        print("Yey!")
        break

Submission status: Wrong Answer

Solution code:
list = []
for i in range(6):
    a = int(input())
    list.append(a)
    
if list[4]-list[0] < list[5]:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

Solution code:
foods = [int(input()) for i in range(5)]
time = 0
rest = list(map(lambda x: x % 10, foods))
for i in range(5):
    if rest[i] == 0:
        time += foods[i]
    else:
        time += foods[i] - rest[i] + 10

if not any(rest):
   print(time)
else:
    print(time - 10 + min([i for i in rest if i != 0]))

Submission status: Wrong Answer

Solution code:
m_list = list()
for k in range(6):
    m = int(input())
    m_list.append(m)

x_list = list()
count = 0
for i in range(0, len(m_list)-2):
    for j in range(i+1, len(m_list)-1):
        x_list.append(m_list[j] - m_list[i])

for a in range(len(x_list)):
    if x_list[a] >= 15:
        count += 1

if count >= 1:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
Ac=((a//10)+1)*10
Bc=((b//10)+1)*10
Cc=((c//10)+1)*10
Dc=((d//10)+1)*10
Ec=((e//10)+1)*10
Af=a%10
Bf=b%10
Cf=c%10
Df=d%10
Ef=e%10

if max(Af,Bf,Cf,Df,Ef)==Af:
  print(a+Bc+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Bf:
  print(Ac+b+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Cf:
  print(Ac+Bc+c+Dc+Ec)  
  
elif max(Af,Bf,Cf,Df,Ef)==Df:
  print(Ac+Bc+Cc+d+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Ef:
  print(Ac+Bc+Cc+Dc+e)