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:
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] < k:
        result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
num = []
j = ''
for i in range(5):
    num.append(int(input()))
ans = int(input())
for i, b in enumerate(num):
    for a in num[i+1:]:
        if a - b > ans:
            print(':(')
            j = ':('
            break
if not ':(' in j:
    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())
k = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
t = [int(input()) for i in range(5)]
t.sort()
count = 0
min_list = [t[0]%10,t[1]%10,t[2]%10,t[3]%10,t[4]%10]
for i in range(5):
    x = min_list[i]
    if x != 0:
        break
f =min([t[0]%10,t[1]%10,t[2]%10,t[3]%10,t[4]%10])
for i in range(5):
    if t[i]%10 == 0 :
        t[i] = t[i]-1
        count = 1
a =(t[4]//10+1)*10
b =(t[3]//10+1)*10
c =(t[2]//10+1)*10
d =(t[1]//10+1)*10
e =(t[0]//10+1)*10
if count == 0:
        print(a+b+c+d+e+f-10)
else:
    if min_list == [0]*5:
        print(a+b+c+d+e)
    else:
        print(a+b+c+d+e+x-10)

Submission status: Wrong Answer

Solution code:
import numpy as np

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


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

Submission status: Wrong Answer

Solution code:
import math

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

xs = [a,b,c,d,e]
divs = [10 if x % 10 == 0 else x % 10 for x in xs]
mindiv = min(divs)
result = sum([math.ceil(x/10) * 10 for x in xs]) - 10 + mindiv
print(result)

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):
        if (v[1] - v[0]) <= k:
            msg = ':('
            break
        msg = 'Yay!'
    
    print(msg)

if __name__ == '__main__':
    main()

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[i] - m_list[j])

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

if count >= 1:
    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())
f = int(input())
seq = (a,b,c,d,e,f)
data = list(itertools.combinations(seq,2))
result = 0
for i in range(len(data)):
    if data[i][0] - data[i][1] < 15:
        result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

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:
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # greatest common divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # least common multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
# n = II()
# dp = [INF] * n
# h = LI()
# dp[0], dp[1] = 0, abs(h[1] - h[0])
# for i in range(2, n):
    # dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i])
    # dp[i] = min(dp[i-2] + abs(h[i]-h[i-2]), dp[i])
# P(dp[n-1])
a = II()
b = II()
c = II()
d = II()
e = II()
k = II()
list = sorted([a,b,c,d,e])[::-1]
for i in range(len(list)):
    for j in range(i+1,len(list)):
        print(list[i],list[j])
        if list[i] - list[j] > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(5)]
k = int(input())
print(":(" if(any([x > k for x in a])) else("Yay!") )

Submission status: Wrong Answer

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

for i in range(1,4):
    if array[i]-array[0] > k: a+=1    
if a>0: print(':(')
else: print('Yay!')

Submission status: Wrong Answer

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

flag = 1
while(len(antennas) != 1):
    for i in range(len(antennas)-1):
        i += 1
        if antennas[i] - antennas[0] <= k:
            continue
        else:
            flag *= 0
            print(":(")
            break
    antennas = antennas[1:]

if flag == 1:
    print('Yay!')

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(5)]
k = int(input())
print(":(" if(any([x >= k for x in a])) else("Yay!") )

Submission status: Wrong Answer

Solution code:
import sys

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

flag = 0

if((e-d)>k):
  print(':(')
  sys.exit()
if((e-d)>k):
 print(':(')
 sys.exit()
if((e-d)>k):
 print(':(')
 sys.exit()
if((e-d)>k):
 print(':(')
 sys.exit()
if((e-d)>k):
 print(':(')
 sys.exit()
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]
ans=0
for i in range(4):
    for j in range(4):
        l=s[i]-s[j]
        if(abs(l)>k):
            ans=ans+1
if(ans==0):
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
a, b, c, d, e, k = [int(input()) for _ in range(6)]



i = abs(e-a)

if i < k:
    print("Yay!")

else:
    print(":(")

Submission status: Wrong Answer

Solution code:
import math

def solve():
  N = int(input())
  ABCDE = [int(input()) for i in range(5)]
  return 4 + math.ceil(N / min(ABCDE))

print(solve())

Submission status: Wrong Answer

Solution code:
def main ():
    antennas= []
    max     = 0
    for i in range(6):
        if i < 5:
            antennas.append(int(input()))
        else:
            max = int(input())
    print (distance_comparison(max,antennas))

def distance_comparison(max,antennas):
    memo = []
    for i in range(len(antennas)):
        compnum = i+1
        for j in range(len(antennas[compnum:])):
            append_data = abs(antennas[i] - antennas[compnum])
            if append_data < max:
                memo.append(append_data)
            else:
                return ":("
            compnum+=1
    return "Yay!"

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())
s=[a,b,c,d,e]
ans=0
for i in range(4):
    for j in range(4):
        l=s[i]-s[j]
        if(abs(l)>k):
            ans=ans+1
if(ans==0):
    print('Yey!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
a, b, c, d, e, k = [int(input()) for _ in range(6)]

# a = int(input())
# b = int(input())
# c = int(input())
# d = int(input())
# e = int(input())
# k = int(input())
print(a, b, c, d, e, k)

i = abs(e-a)

if i < k:
    print("Yay!")

else:
    print(":(")

Submission status: Wrong Answer

Solution code:
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # greatest common divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # least common multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
# n = II()
# dp = [INF] * n
# h = LI()
# dp[0], dp[1] = 0, abs(h[1] - h[0])
# for i in range(2, n):
    # dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i])
    # dp[i] = min(dp[i-2] + abs(h[i]-h[i-2]), dp[i])
# P(dp[n-1])
a = II()
b = II()
c = II()
d = II()
e = II()
k = II()
list = sorted([a,b,c,d,e])[::-1]
for i in range(len(list)):
    for j in range(i+1,len(list)):
        if list[i] - list[j] > k:
            print(':(')
            exit()
print('Yey!')

Submission status: Wrong Answer

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

for i in range(1,4):
    if array[i]-array[0] > k: a+=1    
if (a>0): print(':(')
else: print('Yay!')

Submission status: Wrong Answer

Solution code:
import numpy as np
# points = np.array([0, 1, 2, 3, 4])
points = np.array([int(input()) for _ in range(5)])
thr = int(input())
diff = (points[1:] - points[:4]).max()
if diff <= thr:
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = int(input())
sum = [a,b,c,d,e]
sum.sort()
sum = [int(s) for s in sum]
if (sum[-1] - sum[0]) > k :
    print(":(")

else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
i = [int(input()) for i in range(6)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

Submission status: Wrong Answer

Solution code:
num = []

for k in range(5):
  num.append(int(input()))

k = int(input())

for i in range(4,0,-1):
  for j in range(i):
    if (num[i] - num[j]) > 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())
flag = 0
if k < k - a:
  print(":(")
else:
  print("Yay!")

Submission status: Wrong Answer

Solution code:
i = [int(input()) for i in range(5)]
temp = 0
if i[4] - i[3] > i[4]:
  temp += 1
if i[3] - i[2] > i[4]:
  temp += 1
if i[2] - i[1] > i[4]:
  temp += 1  
if i[1] - i[0] > i[4]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(5)]
flag=False
k=int(input())
for i in range(len(l)):
    for j in range(i+1,len(l)):
        if(l[j]-l[i]<=k):
            flag=True
            break
    if(flag):
        break
if(flag):
    print(":(")
else:
    print('Yay!')

Submission status: Wrong Answer

Solution code:
hoge = [int(input()) for _ in range(6)]

i=0
j=0
flag=0

for i in range(len(hoge)-2):
    for j in range(len(hoge)-2):
        if hoge[j]-hoge[i] > hoge[-1]:
            flag = 1

if flag==0:
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
num = []
for i in range(5):
    num.append(int(input()))
ans = int(input())
for i, b in enumerate(num):
    for a in num[i+1:]:
        if a - b > ans:
            print(':(')
            break
print('Yay!')

Submission status: Wrong Answer

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

if max(a) - min(a) <= 15:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

Solution code:
li = [int(input()) for i in range(6)]

for i in range(4):
    for j in range(4):
        if (li[j] - li[i]) > li[-1] and i!=j:
            print(":(")
            quit()

print("Yay!")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
i = [int(input()) for i in range(5)]
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:
abcde = [int(input()) for i in range(5)]
k = int(input())

ans = "Yay!"
for element in abcde:
    if element > k:
        ans = ":("

print(ans)

Submission status: Wrong Answer

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

flag = 1
while(antennas != []):
    for i in range(len(antennas)-1):
        i += 1
        if antennas[i] - antennas[0] <= k:
            continue
        else:
            flag *= 0
            print(":(")
            break
    antennas = antennas[1:]

if flag == 1:
    print('Yay!')

Submission status: Wrong Answer

Solution code:
antenna = [int(input()) for _ in range(5)]
k = int(input())
 
for i in range(len(antenna)):
  for j in range(len(antenna)):
    if abs(antenna[i]-antenna[j])<=k:
      print("Yay!")
    else:
      print(":(")

Submission status: Wrong Answer

Solution code:
import numpy as np
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

aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
if k > 0:
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

v = []
for i in range(6):
    v.append(I())
k = v.pop()

if all(_ <= k for _ in v):
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
l=[int(input()) for i in range(5)]
flag=False
k=int(input())
for i in range(len(l)):
    for j in range(i+1,len(l)):
        if(l[j]-l[i]==k):
            flag=True
            break
    if(flag):
        break
if(flag):
    print(":(")
else:
    print('Yay!')

Submission status: Wrong Answer

Solution code:
import sys

arr=[int(input()) for i in range(5)]
k=int(input())

for i in arr:
    for j in arr:
        if abs(i - j) > k:
            print(":(")
            sys.exit()

print("Yey!")

Submission status: Wrong Answer

Solution code:
A = input()
B = input()
C = input()
D = input()
E = input()
K = 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())
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:
l = [int(input()),int(input()),int(input()),int(input()),int(input())]
k = int(input())
print(l,k)
i = 4
j = 0
y = 1
while i+1 :
  j = i-1
  while j+1 :
    if l[j-1]-l[i-1] > k : y = 0
    j -= 1
  i -= 1
if y == 1 : print('Yay!')
else : print(':(')

Submission status: Wrong Answer

Solution code:
import numpy as np
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

aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
if k != 0:
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)

Submission status: Wrong Answer

Solution code:
s = sum([int(input()) for i in range(5)])
print("Yay!" if(4 * int(input()) >= s) else(":(") )

Submission status: Wrong Answer

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

for i in range(len(antenna)):
  for j in range(len(antenna)):
    if abs(antenna[i]-antenna[j])<=k:
      print("Yey!")
    else:
      print(":(")

Submission status: Wrong Answer

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

k = int(input())
li = sorted(li)
if k > li[4] - li[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 b - a >= k:
    print(":(")
elif c - a >= k:
    print(":(")
elif c - b >= k:
    print(":(")
elif d - a >= k:
    print(":(")
elif d - b >= k:
    print(":(")
elif d - c >= k:
    print(":(")
elif e - a >= k:
    print(":(")
elif e - b >= k:
    print(":(")
elif e - c >= k:
    print(":(")
elif e - d >= k:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

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

k = input()

ans = True
for i in range(4):
    for j in range(i+1, 5):
        print(x[j] - x[i])
        if k < x[j] - x[i]:
            ans = False

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

Submission status: Wrong Answer

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

for i in range(1,4):
    if (array[i]-array[0]) > k: 
        print(':(')
        exit()
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())

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

for i in list:
    for j in list[1:]:
        if j - i > k:
            print(":(")
            break
    break

else:
    print("Yay!")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = sum([int(input()) for i in range(5)])
print("Yay!" if(4 * int(input()) > s) else(":(") )

Submission status: Wrong Answer

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

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

ans = 'Yay!'
for i in range(0, len(antenna)-1):
    for n in range(i, len(antenna)-1):
        if abs(antenna[i] - antenna[n]) > k:
            ans = ':('
            break

print(ans)

Submission status: Wrong Answer

Solution code:
li =[int(input()) for i in range(6)]
isexist=False

for i in range(4):
    for j in range(4):
        if li[i]-li[j] > li[5] and j!=j and j>i:
            isexist=True

if isexist==True:
    print(":(")
else:
    print("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(4-i):
    if a[i]-a[j]>k:
      ans=":("
      break
if ans==0:
  print("Yay!")
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
y = "Yey!"
n = ":("
a = int(input().strip())
b = int(input().strip())
c = int(input().strip())
d = int(input().strip())
e = int(input().strip())
k = int(input().strip())

if abs(a - e) > k:
        ans = n
else:
        ans = y
print(ans)

Submission status: Wrong Answer

Solution code:
A = input()
B = input()
C = input()
D = input()
E = input()
K = 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 "Yey!"
else:
  print ":("

Submission status: Wrong Answer

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

if max(data) - min(data) <= k:
    print("Yay!")
else:
    print(":()")

Submission status: Wrong Answer

Solution code:
li = [int(input()) for i in range(6)]

for i in range(4):
    for j in range(4):
        if (li[j] - li[i]) and (i!=j) > li[-1]:
            print(":(")
            quit()

print("Yay!")

Submission status: Wrong Answer

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

for i in range(1,4):
    print('a')
    if (array[i]-array[0]) > k: 
        print(':(')
        exit()
print('Yay!')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
hoge = [int(input()) for _ in range(6)]

i=0
j=0
flag=0

while(i<len(hoge)-2):
    while(j<len(hoge)-2):
        if hoge[j]-hoge[i] > hoge[-1]:
            flag = 1
        j+=1
    i+=1

if flag==0:
    print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
A = []
for i in range(6):
    A.append(int(input()))
st = 4 
s = 'Yay!'
for i in range(4): 
    for j in range(st):
        print(A[st], A[st-1-j], A[5])
        if A[st] - A[st-1-j] > A[5]:
            s = ':('
    if s == ':(':
        print(':(になった')
        break
    st -= 1
print(s)

Submission status: Wrong Answer

Solution code:
a=[0]*5
index=0
index_0=0
count=9
s=0
j=0
for i in range(5):
    a[i]=int(input())
    if a[i]%10==0:
        index_0+=1
    else:
        count=min(a[i]%10,count)
        j+=1
    s+=a[i]//10
if j!=0:
    print(s*10+count+(4-index_0)*10)
else:
    print(sum(a))

Submission status: Wrong Answer

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

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-e) <= k:
  ans = "Yay!"
else :
  ans = ":("
 
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())
l = [e, d, c, b, a]
output = []
bad = ':('
ok  = 'Yay!'
for i in range(0, 5):
    d = l[i] - l[4]
    if d >= k:
        output.append(bad)
    elif d < k:
        output.append(ok)
if bad in output:
    print(bad)
elif bad not in output:
    print(ok)

Submission status: Wrong Answer

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



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

cnt = 0

for i in range(0,4):
    for j in range(0,4):
        if (abs(arr[i] - arr[j]) > k):
            cnt =+ 1

if cnt >= 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 abs(a-b)<=k & abs(a-c)<=k & abs(a-d)<=k & abs(a-e)<=k:
    if abs(b-c)<=k & abs(b-d)<=k & abs(b-e)<=k:
        if abs(c-d)<=k & abs(c-e)<=k:
            if abs(d-e)<=k:
                print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = []

for i in range(6):
    A.append(int(input()))

if max(A) - min(A) >= 16:
    print(":(")

else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
i = [int(input()) for i in range(3)]
temp = 0
if i[1] - i[0] > i[2]:
  temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

Submission status: Wrong Answer

Solution code:
input_list = [int(input()) for _ in range(6)]

poles = input_list[:-1]
k = input_list[-1]

clear = True
for i in range(5):
  for j in range(1, 5):
    if poles[i] - poles[j] + k < 0:
      clear = False
      print(':(')
      break

if clear:
  print('Yay!')

Submission status: Wrong Answer

Solution code:
in_list = []
for i in range(5):
  in_list.append(int(input()))
if max(in_list) - min(in_list) >= int(input()):
  print(":(")
else:
  print("Yay!")

Submission status: Wrong Answer

Solution code:
anntena_list = []
 
for i in range(5):
    anntena_list.append(int(input()))
    
m = int(input())
    
flag = False
for i in range(4):
  for j in range(3-i):
    if anntena_list[4-i] - anntena_list[j]  >= m:
      flag = True
      
if flag:
  print(':C')
else:
  print('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(5-i):
    if a[i]-a[j]>k:
      ans=":("
      break
if ans==0:
  print("Yay!")
else:
  print(ans)

Submission status: Wrong Answer

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

for i in range(1,4):
    print('a')
    if (array[i]-array[0]) > k: 
        print(':()')
        exit()
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())


i = abs(e-a)

if i < k:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

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

k = input()

ans = True
for i in range(0, 3):
    for j in range(i+1, 4):
        if k < x[j] - x[i]:
            ans = False

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

Submission status: Wrong Answer

Solution code:
li = [int(input()) for i in range(6)]

for i in range(4):
    for j in range(1,4):
        if li[j] - li[i] > li[-1]:
            print(":(")
            quit()

print("Yay!")

Submission status: Wrong Answer

Solution code:
A = [input() for i in range(5)]
A.sort(key = lambda x:x[-1])
A = [int(a) for a in A]
res = 0
for a in A:
	if a%10 == 0:
		res += a
	else:
		while a%10 != 0:
			a += 1
		res += a 
for a in A:
	b = str(a)
	if b[-1] != '0':
		res -= 10-int(b[-1])
		print(res)
		exit()
print(res)

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 b-c<k and b-d<k and b-e<k and c-d<k and c-e<k and 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())
l = [e, d, c, b, a]
output = []
bad = ':('
ok  = 'Yay!'
for i in range(1, 5):
    d = l[i] - l[4]
    if d >= k:
        output.append(bad)
    elif d < k:
        output.append(ok)
if bad in output:
    print(bad)
elif bad not in output:
    print(ok)

Submission status: Wrong Answer

Solution code:
aa = [int(input()) for _ in range(6)]
ans = "Yay!"
for i in range(4):
    for j in range(4):
        if abs(aa[i] - aa[j]) > aa[5]:
            ans = ':('
            break
    if ans != "Yay!":
        break
print(ans)

Submission status: Wrong Answer

Solution code:
data = [int(input()) for i in range(6)]
print('Yay!' if data[-2] - data[0] > data[-1] else ':(')

Submission status: Wrong Answer

Solution code:
a = []
for i in range(6):
  po = int(input())
  a.append(po)
           
flag = 0
count = 0
for i in range(5):
  for j in range(4-i):
    sa = abs(a[i]-a[i+j+1])
    count = count + 1
    if sa > a[5]:
      print(":(")
      flag = 1
      break

if flag == 0:
  print("Yay!")

Submission status: Wrong Answer

Solution code:
l = []
for i in range(5):
    a = int(input())
    l.append(a)
k = int(input())
diff = []
for i in range(4):
   diff.append(l[i+1] - l[i])
count = 0
for i in range(4):
    if diff[i] > k:
        count += 1
if count > 0:
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
dish = []
time = 0
for i in range(5):
    temp = int(input())
    if temp % 10:
        dish.append(temp)
    else:
        time += temp
if not dish: 
  print(time)
else:
  left = 10 - min([x % 10 for x in dish])
  for i in range(len(dish)):
      dish[i] = dish[i] + 10 - dish[i] % 10
  time = time + sum(dish) - left
  print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
# コンテナの座標（西→東）
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

# 電波が届く最大の距離
k = int(input())

# 最大の距離(=e-a)
max_dis = e -a
        
# 出力
if max_dis < k:
  print('Yay!')
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
X = [0]*6
for i in range(6):
    X[i] = int(input())
print(X)

for a in X:
    for b in X:
        if abs(a - b) > X[-1]:
            print(":(")
            quit()

print("Yay!")