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:
A = []
for i in range(5):
  a = int(input())
  A.append(a)
k = int(input())  
for i in range(5):
  for j in range(i,5):
    if A[j] -A[i] <= k:
      pass
    else:
      print(":(")
      quit()
print("Yay!")

Submission status: Accepted

Solution code:
a,b,c,d,e,k = map(int,open(0).read().split())

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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 = []
for i in range(5):
    a=int(input())
    A.append(a)
A.sort()
k = A[4] - A[0]
K = int(input())
if k<=K:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ais = [int(raw_input()) for _ in range(5)]
k = int(raw_input())
print ':(' if ais[0] + k < ais[-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())
print(':(' if e - a > k else 'Yay!')

Submission status: Accepted

Solution code:
import sys

a = int(sys.stdin.readline())
b = int(sys.stdin.readline())
c = int(sys.stdin.readline())
d = int(sys.stdin.readline())
e = int(sys.stdin.readline())
k = int(sys.stdin.readline())

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

Submission status: Accepted

Solution code:
d = list(map(int, open(0)))
k = d.pop()
for s in d:
    for t in d:
        if abs(s-t) > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

Solution code:
L=[int(input()) for _ in range(5)]
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:
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
if (max(a[:-1]) - min(a[:-1])) <= a[-1]:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
abcde=[int(input()) for i in range(5)]
k=int(input())
for i in range(0,5):
  for j in range(i+1,5):
    if abcde[j]-abcde[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(":(")
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())
List=[a,b,c,d,e]
for i in range(len(List)):
    for j in range(i+1,len(List)):
        if List[j]-List[i]>k:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [a, b, c, d, e]
for v in itertools.combinations(l, 2):
    if abs(v[0]-v[1]) > k:
        print(':(')
        exit()
print('Yay!')

Submission status: Accepted

Solution code:
mn, mx = float('inf'), -float('inf')
for i in range(5):
    a = int(input())
    mn = min(mn, a)
    mx = max(mx, a)
k = int(input())
if mx - mn > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readline_s = sys.stdin.readline
readlines = sys.stdin.buffer.readlines


def main():

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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
*a, k = map(int, open(0).read().split())
if max(a) - min(a) <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
*A, k = map(int, open(0).read().split())

max_diff = max(A) - min(A)

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

Submission status: Accepted

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

ant = [a,b,c,d,e]
flg = True
for i in range(5):
    for j in range(5):
        if i != j:
            #print(dist)
            dist = abs(ant[i]-ant[j])
            if dist > k:
                flg = False
                break
if flg:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
d = []
for i in range(5):
    d.append(int(input()))
k = int(input())
for i, j1 in enumerate(d[:5]):
    for j2 in d[i+1:]:
        if (j1 - j2) ** 2 > k ** 2:
            print(':(')
            exit()
print('Yay!')

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

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

for i in range(4):
    for j in range(i, 5):
        if abs(Ant[j]-Ant[i]) > k:
            print(":(")
            sys.exit()

print("Yay!")

Submission status: Accepted

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

    for i in range(5):
        for j in range(i+1,5):
            if (a[j] - a[i]) <= k:
                continue
            else:
                return ':('

    return 'Yay!'

print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
v=list(map(int,open(0).read().split()))
print(":("if v[5]<v[4]-v[0]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())
print(":(" if max(a,b,c,d,e) - min(a,b,c,d,e) > k else "Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
l=[]
f=0
for i in range(5):
    z=int(input())
    l.append(z)
k=int(input())
for i in range(4):
    for j in range(1,5):
        if math.fabs(l[i]-l[j])>k:
            f=1
            break
if f==1:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

if max(a) - min (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())

x = e - a

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

Submission status: Accepted

Solution code:
lis = []

for _ in range(5):
    lis.append(int(input()))
    
k = int(input())

for i in range(5):
    for j in range(i+1, 5):
        if (lis[j] - lis[i]) > k:
            print(":(")
            exit()

print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = [int(input()) for _ in range(6)]
if num[4] - num[0] > num[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())

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

if M-m<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
import sys
a=list(map(int,open(0).read().split()))
for i in range(5):
  for j in range(5):
    if i==j:
      continue
    elif abs(a[i]-a[j])>a[5]:
      print(':(')
      sys.exit()
else:
  print('Yay!')

Submission status: Accepted

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

check="Yay!"
for i in range(4):
    for j in range(1,5-i):
       
        if arr[i+j]-arr[i]>k:
            check=":("
            break
    if check==":(":
        break
print(check)

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:
import sys
d = [int(input()) for i in range(6)]
 
def check():
    for i in range(5):
        for j in range(5):
            if abs(d[i]-d[j]) > d[5]:
                print(":(")
                sys.exit()
    print("Yay!")
         
check()

Submission status: Accepted

Solution code:
import sys
d = [int(input()) for i in range(6)]

def check():
    for i in range(5):
        for j in range(5):
            if abs(d[i]-d[j]) > d[5]:
                print(":(")
                sys.exit()
    print("Yay!")
         
check()

Submission status: Accepted

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

Submission status: Accepted

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

x=max(a,b,c,d,e)
y=min(a,b,c,d,e)


if x-y>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(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
import itertools


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

# a<b<c<d<e を利用
max_distance = e - a

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

# 全組み合わせの探索
# combs = itertools.combinations([a, b, c, d, e], 2)
# 
# can_connects = [abs(x[0] - x[1]) <= k for x in combs]
# 
# if all(can_connects):
#     print('Yay!')
# else:
#     print(':(')

Submission status: Accepted

Solution code:
import itertools


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

combs = itertools.combinations([a, b, c, d, e], 2)

can_connects = [abs(x[0] - x[1]) <= k for x in combs]

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

Submission status: Accepted

Solution code:
a = list(map(int,[input() for i in range(5)]))
k = int(input())

ans = True
for i in range(5):
    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 = list(map(int,[input() for i in range(5)]))
k = int(input())

ans = True
for i in range(5):
    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 = []
for i in range(5):
    a.append(int(input()))
k = int(input())
ans = 0
for i in range(4):
    for j in range(i+1, 5):
        if a[j] - a[i] > k:
            ans = 1
if ans == 1:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

arr1 = [a, b, c, d, e]
arr2 = [b, c, d, e]
f = 0
for x, y in itertools.product(arr1, arr2):
  if abs(x - y) > k:
    f += 1
if f == 0:
  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 print (":(")

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(6)]
if a[4]-a[0]<=a[5]: 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:
abcdek=[]
for i in range(6):
  abcdek.append(int(input()))
ans="Yay!"
k=abcdek[5]
for i in range(5):
  p=abcdek[i]
  for j in range(i+1,5):
    q=abcdek[j]
    if q-p>k:
      ans=":("
      break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = "Yay!"
for i in range(4):
    for j in range(i+1, 5):
        d = l[j]-l[i]
        # print(d)
        if d>l[-1]:
            flag = ":("
print(flag)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys

read= sys.stdin.buffer.read
l= list(map(int, open(0).read().split()))

if (max(l[:5])-min(l[:5]))>l[5]:print(':(')
else:print('Yay!')

Submission status: Accepted

Solution code:
x = [0]*5

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

Submission status: Accepted

Solution code:
a,b,c,d,e,k=(int(input())for _ in range(6))
print('Y:a(y !'[e-a>k::2])

Submission status: Accepted

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

import itertools

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


for i, j in itertools.combinations(range(5), 2):
    num1, num2 = abcdek[i], abcdek[j]
    if num2-num1 > abcdek[-1]:
        print(":(")
        exit()


print("Yay!")

Submission status: Accepted

Solution code:
import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
from fractions  import gcd

input=sys.stdin.readline
x=[int(input()) for _ in range(5)]
k=int(input())

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

Submission status: Accepted

Solution code:
def main():
  num = [int(input()) for i in range(5)]
  n =int(input())
  flg=0
  for i in range(0,4):
    for j in range(i,5):
      if abs(num[j]-num[i])>n :
        flg=1
        break
  if flg==0 :
    print('Yay!')
  else :
    print(':(')

main()

Submission status: Accepted

Solution code:
l=[int(input()) for _ in range(5)][::-1]
k=int(input())
for i,a in enumerate(l):
    for b in l[i+1:]:
        if a-b>k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=int(input());input();input();input();e=int(input());
if e - a <= int(input()):
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
li = [I() for _ in range(6)] #n行に１つずつ入力される整数
if (li[4] - li[0]) <= li[5]:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
abcde = [int(input()) for _ in range(5)]
k = int(input())
ans = 'Yay!'
for i in range(5):
  for j in range(i+1,5):
    if abs(abcde[i]-abcde[j]) > k:
      ans = ':('
      break

print(ans)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[int(input()) for _ in range(5)];k=int(input());print(':(' if max(a)-min(a)>k 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 k< b-a:
  print(":(")
elif k< c-a:
  print(":(")
elif k< d-a:
  print(":(")
elif k< e-a:
  print(":(")
elif k< c-b:
  print(":(")
elif k< d-b:
  print(":(")
elif k< e-b:
  print(":(")
elif k< d-c:
  print(":(")
elif k< e-c:
  print(":(")
elif k< e-d:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
antennas = [int(input()) for _ in range(5)]
distance = int(input())
antennas_distance = abs(sorted(antennas)[len(antennas)-1] - sorted(antennas)[0])
print(':(' if antennas_distance > distance else 'Yay!')

Submission status: Accepted

Solution code:
antennas = [int(input()) for _ in range(5)]
distance = int(input())
antennas.sort()
antennas_distance = abs(antennas[len(antennas)-1] - antennas[0])
print(':(' if antennas_distance > distance else 'Yay!')

Submission status: Accepted

Solution code:
antennas = []
distance = 0
for _ in range(5):
  antennas.append(int(input()))
distance = int(input())
for i in range(len(antennas)):
  for j in range(i+1, len(antennas)):
    if distance < abs(antennas[i] - antennas[j]):
      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 (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:
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:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
result='Yay!'
q=[a,b,c,d,e]
for i in q:
    for x in q:
        if i-x>k:
            result=':('
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())
result='Yay!'
r=[a,b,c,d,e]
for i in r:
    for x in r:
        if i-x>k:
            result=':('
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a_list = [int(input()) for i in range(5)]
    k = int(input())
    
    ans = "Yay!"
    
    if a_list[4] - a_list[0] > k:
        ans = ":("
    
    print(ans)


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

Submission status: Accepted

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

import itertools

d=[]

for v in itertools.combinations(l,2):
    d.append(abs(v[0]-v[1]))

if max(d)>k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
*l,k=map(int,open(0))
print('Yay!' if max(l)-min(l)<=k else ':(')

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
B = int(input())
B = int(input())
B = int(input())
K = int(input())
if B-A <= K:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
ma = a
mi = a
for i in range(4):
  x = int(input())
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi <= 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 e - a > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
from itertools import combinations

# input
antennas = []
a_append = antennas.append
for i in range(5):
    a_append(int(input()))

k = int(input())

# check
pattern = list(combinations(antennas, 2))
max_len = max(
    [
        abs(i - j)
        for i, j in pattern
    ]
)
if max_len <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    K = [int(input()) for i in range(5)]
    k = int(input())
    ans = True
    for i in range(5):
        for j in range(i + 1, 5):
            if K[j] - K[i] > k:
                ans = False
                break

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if (x[4] - x[0]) > 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(':(')
else:
    print('Yay!')

Submission status: Accepted

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

def check():
    if A[-2]-A[0]>A[-1]:
        return ':('
    return 'Yay!'
print(check())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
a = np.array([int(input()) for _ in range(5)])
k = int(input())

bl = a.max() - a.min() <= k

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

Submission status: Accepted

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

ans = 0
for i in range(4):
  for j in range(i + 1, 5):
    ans += int(abs(ABCDE[i] - ABCDE[j]) > k)
    
if ans > 0:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations
L  = []
for i in range(5):
    L.append(int(input()))
k = int(input())
for i,j in combinations(L,2):
    if abs(i-j) > k:
        print(":(")
        break
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a = ii()
    for _ in range(3):
        ii()
    e = ii()
    k = ii()
    print('Yay!') if e - a <= k else print(':(')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x=[0]*5
for i in range(5):
    x[i]=int(input())
k=int(input())
ans=True
for i in range(5):
    for j in range(i+1,5):
        if abs(x[i]-x[j])>k:
            ans=False
            break
        
if ans==True:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

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

k = int(input())

from itertools import combinations

c = list(combinations(Anntena,2))

flg=0
for a in c:
    dist = abs(a[1] - a[0])

    if dist>k:
        flg+=1

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

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:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
def main():
    a=I()
    b=I()
    c=I()
    d=I()
    e=I()
    k=I()
    yn= 'Yay!' if e-a<=k else ':('
    print(yn)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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