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:
# -*- coding: utf-8 -*-

#----------
L_list = [int(input().strip()) for _ in range(5)]
k = int(input().strip())
#----------
L_list.sort()

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

if flag == True:
  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:
x =[int(input()) for i in range(5)]
k = int(input())

x_max = max(x)
x_min = min(x)

if x_max-x_min <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = [int(input()) for _ in range(5)]
k = int(input())
M = max(x)
m = min(x)
if M-m > k:
  print(':(')
else:
  print("Yay!")

Submission status: Accepted

Solution code:
#ABC-123-A
antenna_list = []
ans = "Yay!"

for _ in range(5):
    antenna = int(input())
    antenna_list.append(antenna)
    
k = int(input())
    
for i in range(4):
    if ans == ":(":
        break
    for j in range(i+1, 5):
        if abs(antenna_list[i] - antenna_list[j]) > k:
            ans = ":("
            break
            
print(ans)

Submission status: Accepted

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

list_1.sort(reverse=True)
ans = 0

for j in list_1:
    ind = list_1.index(j)
    while ind <= 3:
        ind += 1
        if k < j - list_1[ind]:
            ans += 1
        
if ans == 0:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
*a, k = [int(input()) for _ in range(6)]
can = True
for a1 in a:
    for a2 in a:
        if abs(a1 - a2) > k:
            can = False
print('Yay!' if can else ':(')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def antenna(s,k):
    while True:
        for i in range(5):
            for j in range(5):
                if i!=j:
                    if abs(s[i]-s[j])>k:
                        return ':('
        return 'Yay!'

print(antenna(S,K))

Submission status: Accepted

Solution code:
import sys
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
antena = [a,b,c,d,e]
state = 1
for i in range(len(antena)):
    for j in range(i+1,len(antena)):
        if antena[j]-antena[i]<=k:
            state = 1
        else:
            state = 0
            break
    if state == 0:
        print(":(")
        sys.exit()
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 = sorted([int(input()) for _ in range(5)])
k = int(input())
print("Yay!" if (A[4]-A[0])<=k else ":(")

Submission status: Accepted

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

print("Yay!" if max(l)-min(l)<=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())

m = min(a, b, c, d, e)
M = max(a, b, c, d, e)

if M - m > 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 k < e - a:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
import sys

inputs = [int(row.split()[0]) for row in sys.stdin.readlines()]

max_distance = inputs[-1]
antenna_list = inputs[:-1]

antenna_list = sorted(antenna_list)    

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

Submission status: Accepted

Solution code:
dentyu = []
for i in range(5):
    dentyu.append(int(input()))
k = int(input())
flag = False
for i in range(4):
    for j in range(i,5):
        if k < abs(dentyu[i]-dentyu[j]):
            flag = True
            break 
print('Yay!' if flag==False else ':(')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc123/tasks/abc123_a

import itertools
li = []
for _ in range(5):
    li.append(int(input()))
di = int(input())
for a, b in itertools.combinations(li, 2):
    if abs(a - b) > di:
        print(":(")
        exit()
print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=[None]*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:
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()) for i in range(5)]
k = int(input())
print('Yay!') if a[4]-a[0] <= k else print(':(')

Submission status: Accepted

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

for i in range(len(antennas)):
  for j in range(len(antennas)):
    if(i != j and abs(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(":(")
else:
    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(":(")
else:
    print("Yay!")

Submission status: Accepted

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

    max_antena = max(a,b,c,d,e)
    min_antena = min(a,b,c,d,e)

    print('Yay!' if max_antena - min_antena <= k else ':(')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = sys.stdin.readline

def eprint(s):
    if type(s) != type('str'):
        s=str(s)

    sys.stderr.write(s+'\n')
    return

def main():
    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!')
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
r=[int(input()) for i in range(6)]
if r[4]-r[0]>r[5]:
  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:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

lst = [a,b,c,d,e]
if max(lst) - min(lst) > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
a = int(input())
for _ in range(3):
    _ = input()
e = int(input())
k = int(input())
if e-a<=k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

for x, y in list(itertools.combinations([a, b, c, d, e], 2)):
    if y - x > k:
        print(':(')
        exit()
else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = []
for i in range(5):
    a.append(int(input()))
a.sort()
k = int(input())
if a[4] - a[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())
p = max(k,abs(a-b),abs(a-c),abs(a-d),abs(a-e),abs(b-c),abs(b-d),abs(b-e),abs(c-d),abs(c-d),abs(d-e))
if p == k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

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

import itertools as it
x1 = list(it.combinations(range(5), 2))

ans = "Yay!"
for i,j in x1:
    if abs(a1[i] - a1[j]) > k:
        ans = ":("

print(ans)

Submission status: Accepted

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

flag = True
for i in range(4):
  for j in range(i, 5):
    if abs(a[i] - a[j]) > a[len(a)-1]:
      flag = False
      break

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

Submission status: Accepted

Solution code:
import itertools

A = list(map(int,open(0).read().split()))
k = A.pop()

B = itertools.combinations(A, 2)

for a, b in B:
    if abs(a - b) > k:
        print(':(')
        break
else:
    print('Yay!')

Submission status: Accepted

Solution code:
A = list(map(int,open(0).read().split()))
k = A.pop()
 
ans = 'Yay!'
 
for i in range(len(A)-1):
    for j in range(i+1, len(A)):
        d = abs(A[i] - A[j])
        if d > k:
            ans = ':('
print(ans)

Submission status: Accepted

Solution code:
p = []

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

far = int(input())
res = True

for x in range(len(p)):
    for xx in range(x+1, len(p)):
        if p[xx] - p[x] > far:
            res = False

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

Submission status: Accepted

Solution code:

x = []
for _ in range(5):
    x.append(int(input()))

k = int(input())

x.sort()
r = x.pop()

for i in x:
    if r - i > k:
        print(':(')
        break
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())
xs = [a, b, c, d, e]
result = 'Yay!'
for i in range(5):
    for j in range(i + 1, 5):
        if k < xs[j] - xs[i]:
            result = ':('
            break
print(result)

Submission status: Accepted

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

def answer():
  if e - a > k:
    return False
  return True

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    K = int(input())
    print('Yay!'if max(A, B, C, D, E) - min(A, B, C, D, E) <= K else ':(')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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())

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

can = False
for i in range(len(list)):
  for j in range(len(list)):
    if i == j:
      continue
    if abs(list[i] - list[j]) <= k:
      can = True
    else:
      can = False
      break
      
if can:
  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:
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:
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())
if a[-1] - a[0] > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    L = [INT() for _ in range(5)]
    k = INT()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

can = True

for i in antenna:
    for j in antenna:
        if i == j or i < j:
            continue
        else:
            if abs(i - j) > k:
                can = False
                break
            else:
                continue

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

lst = list(int(input()) for _ in range(6))

print("Yay!" if lst[4] - lst[0] <= lst[5] 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(e - a <= k):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

    for i in AtoE:
        for j in AtoE:
            if abs(i - j) > k:
                print(':(')
                exit()
    else:
        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:
a = [0] * 5
for i in range(5):
    a[i] = int(input())
k = int(input())
if (max(a) - min(a) > k): print(":("); exit(0)
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#123 a
z=[]
ans=0
for i in range(5):
    z.append(int(input()))
k=int(input())

for i in range(4):
    for j in range(i+1,5):
        if k<(z[j]-z[i]):
            ans+=1
if ans:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
from itertools import combinations

A = [int(input()) for _ in range(5)]
K = int(input())

for x, y in combinations(A, 2):
  z = abs(x-y)
  if z > K:
    print(":(")
    exit()
print("Yay!")

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

a = [ni() for i in range(5)]
k = ni()

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

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

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(5):
    if A[i]-A[j]>A[5]:
      print(':(')
      exit()
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())
lis=[a,b,c,d,e]
lis.sort()

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

Submission status: Accepted

Solution code:
import itertools
p=list()
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
k=int(input())
c=list(itertools.combinations(p,2))
d=list()
for i in range(len(c)):
  d.append(c[i][1]-c[i][0])
if max(d)>k:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

if max(lst)-min(lst) <= int(input()):
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
arr = [int(input()) for _ in range(6)]
arr, k = sorted(arr[:-1]), arr[-1]
print('Yay!' if arr[-1]-arr[0] <= k else ':(')

Submission status: Accepted

Solution code:
A= [int(input()) for i in range(6)]
answer = "Yay!"
for u in range(4):
  for s in range(u,5):
    if A[s] - A[u] > A[5]:
      answer = ":("
print(answer)

Submission status: Accepted

Solution code:
import sys
import math
import itertools

a=[]

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

for j in itertools.combinations(a,2):
	if a[5]<j[1]-j[0]:
		print(":(")
		sys.exit()

print("Yay!")

Submission status: Accepted

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

k = int(input())


if max(A)-min(A) > k:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
N = []

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

ans = "Yay!"
for i in range(5):
    for j in range(i+1,5):
        dist = abs(N[j] - N[i])
        
        if dist > N[5]:
            ans = ":("

print(ans)

##5m

Submission status: Accepted

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

i = e-a

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

Submission status: Accepted

Solution code:
antena = [int(input()) for _ in range(5)]
k = int(input())
for i in range(5):
    for j in range(i + 1, 5):
        a = antena[i]
        b = antena[j]
        if b - a > k:
            print(':(')
            exit()
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 = [int(input()) for i in range(6)]
print(['Yay!',':('][l[4]-l[0]>l[5]])

Submission status: Accepted

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

if antennas[4] - antennas[0] > k:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x=[int(input()) for _ in range(6)]
f=True
for i in range(5):
    for k in range(i,5):
        if x[k]-x[i]>x[5]:
            f=False
            break
print('Yay!' if f 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 a - e > k or a - e < -k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())

sub = 0
a = int(input())
x = int(input())
x = int(input())
x = int(input())
e = int(input())

k = int(input())

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

Submission status: Accepted

Solution code:
A=list(int(input()) for _ in range(6))

if A[-2]-A[0]>A[-1]:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import sys

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

def main():
    x.sort()
    return 'Yay!' if x[-1] - x[0] <= k else ':(' 

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
max_dis = 0
a = int(input())
for _ in range(3):
    input()
b = int(input())
k = int(input())
if b - a <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[0]*5
for i in range(5):
  a[i]=int(input())
k=int(input())
ans=True
for i in range(4):
  for j in range(i+1,5):
    if a[j]-a[i]>k:
      ans=False
if ans:
  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 a<b<c<d<e :
  if e - a <= k :
    if d - a <= k:
      if c - a <= k:
        if b - a <= k:
          print('Yay!')
  else:
    print(":(")

Submission status: Accepted

Solution code:
def main():
    antenna = []
    for _ in range(5):
        antenna.append(int(input()))
    k = int(input())
    result = True
    for i in range(5):
        for j in range(i + 1, 5):
            if antenna[j] - antenna[i] > k:
                result = False
    if result:
        print("Yay!")
    else:
        print(":(")


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())
 
 
 
array=[a,b,c,d,e]
if(max(array)-min(array) <= k):
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
def main():
    a = [int(input()) for i in range(6)]
    if a[4] - a[0] > a[5]:
        print(':(')
    else:
        print('Yay!')
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b,c,d,e = [int(input()) for i in range(5)]
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())

poles = []
poles.append(a)
poles.append(b)
poles.append(c)
poles.append(d)
poles.append(e)

able_poles = 0
for i in range(4):  # あくまでここではindex番号での組み合わせを抽出する
    for j in range(i+1, 5):
        if abs(poles[i]-poles[j]) <= k:
            able_poles += 1
if able_poles == 10:  # もっとスマートな方法ない？
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d,e,f = list(int(input()) for _ in range(6))
print("Yay!" if e-a<= f else ":(")

Submission status: Accepted

Solution code:
l1 = []
for _ in range(6):
  l1.append(int(input()))
 
if (l1[4] - l1[0]) > l1[5]:
  r = ':('
else:
  r = 'Yay!'
  
  
print(r)

Submission status: Accepted

Solution code:
l = [int(input()) for _ in [0] * 6]
#print(l)
k=l.pop()
##print
if l[4] - l[0] > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 12, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

ADK = list(map(int, read().split()))
print('Yay!' if ADK[4] - ADK[0] <= ADK[-1] else ':(')

Submission status: Accepted

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

f = True

for i in range(5):
    if a[4] - a[0] > a[5]:
        f = False

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

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:
import itertools
li = [int(input()) for _ in range(5)]
k = int(input())

li = list(itertools.combinations(li, 2))
flag = True
for i,j in li:
    if j-i>k:
        flag = False
        break

if flag:
    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())

l = [a, b, c, d, e]
cnt = 0

for i in range(len(l)):
    for j in range(len(l)-i):
        if(l[i]-l[j] > k):
            cnt += 1
            break
if(cnt==0):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

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

flg = True
for i in range(len(antena)):
  for j in range(len(antena)):
    if antena[i] - antena[j] > k:
      flg = False
      break
    
if flg:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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

for i in range(5):
    for j in range(i, 5):
        if k < abs(antenna[i] - antenna[j]):
            print(":(")
            quit()

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 abs(e-a)<=k:
    print('Yay!')
else:
    print(':(')

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:
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)]
dist = int(input())
print(':(' if a[-1] - a[0] > dist else 'Yay!')

Submission status: Accepted

Solution code:
import itertools

aList = []

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

k = int(input())

aiList = list(itertools.combinations(aList,2))

for j in aiList:
  if j[1] - j[0] >k:  
    print(":(")
    exit(0)

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())
s = sorted([a,b,c,d,e])
print(':(' if s[-1] - s[0] > k else 'Yay!')

Submission status: Accepted

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

Submission status: Accepted

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