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: Accepted

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')

def main():
  l = [int(input()) for _ in range(5)]
  k = int(input())
  if l[-1]-l[0]>k:
    print(':(')
  else:
    print('Yay!')
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

if max(n) - min(n) > k:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

a = [int(input()) for _ in range(6)]

p = a[:5]

if max(p) - min(p) > a[-1]:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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: Accepted

Solution code:
import itertools
import fractions
def main():
  L = [] * 5
  a = L.append(int(input()))
  b = L.append(int(input()))
  c = L.append(int(input()))
  d = L.append(int(input()))
  e = L.append(int(input()))
  k = int(input())
  ans = 'Yay!'
  for n,m in itertools.combinations(L,2):
    if abs(n-m) <= k:
      pass
    else:
      ans = ':('
      break
  print(ans)

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

def combination(n, m):
    return m - n

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

Submission status: Accepted

Solution code:
a=[int(input()) for _ in range(5)]
k=int(input())
ans="Yay!"
for p in a:
    for q in a:
        if abs(p-q)>k:
            ans=":("
print(ans)

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(6)]
cnt = 0
for i in range(5):
    for j in range(i, 5):
        if l[j] - l[i] > l[5]:
            cnt += 1
if cnt == 0:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
a = int(input())
input()
input()
input()
e = int(input())
k = int(input())

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

Submission status: Accepted

Solution code:
import sys

*x, k = map(int, sys.stdin.read().split())
x.sort()

def main():
    ans = 'Yay!' if x[-1] - x[0] <= k else ':('
    print(ans)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
a,b,c,d,e,k=[int(input()) for i in range(6)]
print("Yay!" if e - a <= k else ":(")

Submission status: Accepted

Solution code:
from itertools import combinations
import sys

x = [input() for _ in range(5)]
k = int(input())

for i in combinations(x,2):
    tmp = abs(int(i[0])-int(i[1]))
    if(tmp > k):
        print(':(')
        sys.exit()
print('Yay!')

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a =[]
    for i in range(6):
        s = int(input())
        a.append(s)

    flag =0

    for i in range(0,5):
        for j in range(i,5):
            if a[j] -a[i] >a[5]:
                flag +=1

    if flag >0:
        print(":(")
    else:
        print("Yay!")

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
a=ii()
b=ii()
c=ii()
d=ii()
e=ii()
k=ii()

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

Submission status: Accepted

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

antennas=[a,b,c,d,e]
def check():
    for i in range(0,4):
        for j in range(1,5):
            if antennas[j]-antennas[i]>k:
                print(':(')
                return None
    print('Yay!')

check()

Submission status: Accepted

Solution code:
#conding 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("Yay!")
else:
  print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

judge = 'Yay!'
diff = coordinate[-1] - coordinate[0]

if (diff > k):
    judge = ':('

print(judge)

Submission status: Accepted

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: Accepted

Solution code:
li = [int(input()) for _ in range(5)]
k = int(input())
for i in range(5):
    for j in range(i + 1, 5):
        if li[j] - li[i] > k:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

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

if max(antn) - min (antn) > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import sys

*antennas, k = map(int, sys.stdin.read().split())
num = 0
for i in range(4):
    for j in range(i+1, 5):
        if abs(antennas[i] - antennas[j]) > k:
            num += 1
print(':(' if num else 'Yay!')

Submission status: Accepted

Solution code:
ae = [int(input()) for _ in range(5)]
ae.sort()
if ae[-1] - ae[0] <= int(input()):
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

Solution code:
d = [int(input()) for i in range(5)]
k = int(input())
all_dis  = []
for i in range(4):
    for j in range(i+1,5):
        all_dis.append(d[j]-d[i])
for i in all_dis:
    if i > k:
        print(':(')
        exit()
print('Yay!')

Submission status: Accepted

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

x = [int(input()) for _ in range(5)]
k = int(input())

if max(x) - min(x) <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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: Accepted

Solution code:
def main():
  #n = int(input())
  #s = input()
  #s = input().split()
  #a,b = list(map(int,input().split()))
  #a = [list(map(int,input().split())) for i in range(6)]
  a = [int(input()) for i in range(6)]
  ans = 0
  
  
  if a[4] - a[0] > a[5]:
    print(":(")
    exit()
  print("Yay!")
  
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
i = 0
zahyou = []
while i<6:
    zahyou.append(int(input()))
    i +=1
print('Yay!' if zahyou[4]-zahyou[0] <= zahyou[5] else ':(')

Submission status: Accepted

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

#%%
import itertools

flag = True
for v1, v2 in itertools.combinations(antenna, 2):
    if abs(v1 - v2) > k:
        flag = False
        break

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

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(5)]
k = int(input())
for i in range(4):
  if a[i+1] - a[0] > k:
    print(":(")
    exit()
print("Yay!")

Submission status: Accepted

Solution code:
# | Its_Rashid | #
v = [int(input()) for i in range(5)]
a = int(input())
for i in range(0 , 5) :
    for j in range(1 ,5) :
        if v[j] - v[i] > a:
            print(':(')
            quit()
else :
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
# coding: utf-8

a = list(int(input()) for i in range(5))
k = int(input())

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

Submission status: Accepted

Solution code:
flag = "ok"
list_A = [i for i in range(6)]
for i in range(6):
  list_A[i] = int(input())
for j in range(5):
  for l in range(5):
    if (list_A[j]-list_A[l]) > list_A[5]:
      flag = "ng"
if flag == "ok":
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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: Accepted

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

print('Yay!' if A[4] - A[0] <= k else ':(')

Submission status: Accepted

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

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

Submission status: Accepted

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

if l[4]-l[0]>k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
d11 = b - a
d12 = c - a
d13 = d - a
d14 = e - a
d21 = c - b
d22 = d - b
d23 = e - b
d31 = d - c
d32 = e - c
d41 = e - d
if d11 <= k and d12 <= k and d13 <= k and d14 <= k and d21 <= k and d22 <= k and d23 <= k and d31 <= k and d32 <= k and d41 <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
v = [int(input()) for _ in range(5)]
k = int(input())
if max(v) - min(v) <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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(":(")
elif e - b > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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(":(")
elif e - b > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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 d - a > k:
    print(":(")
elif e - a > k:
    print(":(")
elif c - b > k:
    print(":(")
elif d - b > k:
    print(":(")
elif e - b > k:
    print(":(")
elif d - c > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
atoe = [a, b, c, d, e]
flag = True
for i in atoe:
    if not flag: break
    for j in atoe:
        if abs(i-j) > k:
            flag = False
            print(':(')
            break
if flag:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = [int(input()) for _ in range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')

Submission status: Accepted

Solution code:
# ABC123 A

def main():

    antennas = []
    for _ in range(5):
        char = int(input())
        antennas.append(char)
    
    k = int(input())
    result = 'Yay!'
    
    for antenna in antennas[::-1]:
        if antenna - antennas[0] > k:
            result = ':('
            break
    
    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
antena = [0] * 5
for i in range(5):
    antena[i] = int(input())
antena.sort()
k = int(input())
if antena[-1] - antena[0] > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

if A[4] - A[0] > A[5]:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
an = list(int(input()) for _ in range(5))
k = int(input())

if abs(an[4] - an[0]) <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
for i in range(5):
  if i == 0:
    a = int(input())
  elif i == 1 or i == 2 or i == 3:
    tmp = int(input())
  else:
    b = int(input())
k = int(input())
if k >= b - a:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(5)]
k = int(input())
res = "Yay!"
for i in range(4):
    for j in range(1, 5):
        if abs(a[i] - a[j]) > k:
            res = ":("
print(res)

Submission status: Accepted

Solution code:
a = [0]*6
for i in range(6):
    a[i] = int(input())
for i in range(5):
    for j in range(i+1,5):
        if abs(a[i]-a[j]) > a[5]:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")

Submission status: Accepted

Solution code:
antenna = []
N = 5
for _ in range(N):
    antenna.append(int(input()))
k = int(input())
ans = 'Yay!'
for i in range(N - 1):
    for j in range(1, N):
        if antenna[j] - antenna[i] > k:
            ans = ':('
            break
print(ans)

Submission status: Accepted

Solution code:
x=[0]*5
k=0
for i in range(5):
	x[i]=int(input())
t=int(input())
x.sort()

if x[0]+t<x[4]:
	print(':(')
else:
	print('Yay!')

Submission status: Accepted

Solution code:
N = 5
List = [int(input()) for _ in range(N)]
K = int(input())
# print(List)
flag = 0

for i in range(N-1):
    for j in range(i+1,N):
        k = List[j]-List[i]
        # print(k)
        if k>K:
            flag=1
            break

if flag==1:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
N = [int(input()) for i in range(5)]
k = int(input())
if max(N)-min(N) > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
n=[int(input()) for i in range(5)]
m=int(input())
if max(n)-min(n)>m:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
q = [int(input()) for i in range(5)]; k = int(input())
if q[-1] - q[0] > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = 0
b = 0
k = 0
for i in range(6):
  t = int(input())
  if(i == 0):
    a = t
  elif(i == 4):
    b = t
  elif(i == 5):
    k = t

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

Submission status: Accepted

Solution code:
k = 0
a = 0
b = 0
for i in range(6):
  t = int(input())
  if(i == 0):
    a = t
  elif(i == 4):
    b = t
  elif(i == 5):
    k = t

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

Submission status: Accepted

Solution code:
from itertools import combinations as comb
import sys


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

    pair_antenna = list(comb(antennas, 2))
    for pair in pair_antenna:
        diff = pair[1] - pair[0]
        if diff > k:
            print(":(")
            sys.exit(0)
    print("Yay!")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

answer = "Yay!"

for i in range(4):
    if max(a)-min(a) > k:
        answer = ":("

print(answer)

Submission status: Accepted

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

answer="Yay!"

for i in range(4):
    if max(a)-min(a)>k:
        answer=":("

print(answer)

Submission status: Accepted

Solution code:
li = []

for i in range(5):
    li.append(int(input()))

k = int(input())

if li[-1] - li[0] <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

flag = False
for i in range(5):
    for j in range(5):
        if i == j:
            continue
        if abs(A[i] - A[j]) <= k:
            continue
        flag = True

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

Submission status: Accepted

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

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

Submission status: Accepted

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]
print('Y:a(y !'[max(ls)-min(ls)>k::2])

Submission status: Accepted

Solution code:
A = [int(input()) for _ in range(5)]
k = int(input())
if max(A) - min(A) <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:

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

dis = e - a
if k >= dis:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:

antenna = [0] * 5

for i in range(5):
    antenna[i] = int(input())

k = int(input())
judge = 0
for i in range(5):
    for j in range(i + 1, 5):
        if abs(antenna[i] - antenna[j]) > k:
            judge = 1
            break

print(":(" if judge == 1 else "Yay!")

Submission status: Accepted

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: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    *line, k = [int(sys.stdin.readline().rstrip()) for _ in range(6)]
    print(':(' if max(line) - min(line) > k else 'Yay!')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# A - Five Antennas
import itertools
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

for v in itertools.combinations([a,b,c,d,e],2):
    if (abs(v[1]-v[0])>k):
        print(":(")
        exit()

print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

if max(l) - min(l) > n:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:

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


ans = e - a
if k >= ans:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

for i in range(5):
    for j in range(i):
        if Antennas[i]-Antennas[j] > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

    if abs(a-e) <= k:
        print('Yay!')
    else:
        print(':(')

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
li=[]
for i in range(5):
  li.append(int(input()))
k=int(input())
ans="Yay!"
for i in range(5):
  for j in range(5-i):
    if li[j]-li[i]>k:
      ans=":("
      break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=[int(input()) for i in range(5)]
k=int(input())
for i in range(5):
    for j in range(i,5):
        if abs(A[i]-A[j])>k:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

Solution code:
import sys

*A, k = (int(input()) for _ in range(6))
dist = 0
for i, v in enumerate(A):
    for j in A[i:]:
        dist = j - v
        if dist > k:
            print(":(")
            sys.exit()

print("Yay!")

Submission status: Accepted

Solution code:
# coding: utf-8

antenna = list(sorted([int(input().rstrip()) for i in range(5)]))

require = int(input().rstrip())

if antenna[4] - antenna[0] <= require:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
stdin = []
for x in range(6):
    stdin.append(int(input()))
a,b,c,d,e,k = (x for x in stdin)
ans = "Yay!"

for x in range(len(stdin)- 1):
    if x != len(stdin) - 2:
        for y in range(x+1,len(stdin)-1):
            if abs(stdin[x]-stdin[y]) > k:
                ans = ":("
print(ans)

Submission status: Accepted

Solution code:
abcde = []
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
k = int(input())

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  xs = [int(input()) for i in range(5)]
  k = int(input())
  for i in range(len(xs)):
    for j in range(i+1, len(xs)):
      if xs[j] - xs[i] > k:
        print(':(')
        return
  print('Yay!')


if __name__=='__main__':
  main()

Submission status: Accepted

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: Accepted

Solution code:
L=[]
for i in range(5):
	L.append(int(input()))
S=[]
for i in range (4):
	for j in range(i+1,5):
		S.append(abs(L[i]-L[j]))
K=int(input())
if max(S)<=K:
	print("Yay!")
else:
	print(":(")

Submission status: Accepted

Solution code:
l=[int(input()) for i in range(6)]
k=l.pop(-1)
l.sort()
if l[4]-l[0]<=k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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: Accepted

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: Accepted

Solution code:
l = []
for _ in range(5):
    l.append(int(input()))
k = int(input())
l.sort()
if l[4] - l[0] <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

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

Submission status: Accepted

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

l = [a, b, c, d, e]
n = sorted(l)[4]-sorted(l)[0]

if n <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
def main():
    array = []
    a = int(input())
    for _ in range(4):
        array.append(int(input()))
    k = int(input())

    for p in array:
        if p - a > k:
            print(":(")
            exit()
    print("Yay!")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = [INT() for _ in range(5)]
k = INT()

a = sorted(a)

if (a[len(a) - 1] - a[0]) <= k:
	print("Yay!")
else:
	print(":(")

Submission status: Accepted

Solution code:
ls = sorted([int(input()) for _ in 'abcde'])
k = int(input())

print('Yay!' if ls[-1] - ls[0] <= k else ':(')

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(6)]
print("Yay!") if a[-2] - a[0] < a[-1] + 1 else print(":(")

Submission status: Accepted

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

if A[-1] - A[0] > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

if max(antenna) - min(antenna) <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    X = (a, b, c, d, e)
    for i, x in enumerate(X):
        for xx in X[i+1:]:
            if abs(x - xx) > k:
                return ':('
    return 'Yay!'

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    e = int(next(tokens))  # type: int
    k = int(next(tokens))  # type: int
    print(solve(a, b, c, d, e, k))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

k = int(input())

flag = True
for i in range(len(arr)-1):
    for j in range(i+1,len(arr)):
        if arr[j] - arr[i] > k:
            flag = False

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

Submission status: Accepted

Solution code:
from itertools import combinations
a2e = [int(input()) for i in range(5)]
k = int(input())

com = list(combinations(list(range(5)), 2))
ans = "Yay!"
for i in com:
    if abs(a2e[i[0]] - a2e[i[1]]) > k:
        ans = ":("
        break

print(ans)

Submission status: Accepted

Solution code:
#123_A
D=[int(input()) for _ in range(5)]
k=int(input())
flg=all(abs(D[p]-D[q])<=k for p in range(0,5) for q in range(p+1,5))
print('Yay!' if flg else ':(')

Submission status: Accepted

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