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

# write code...

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

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

Submission status: 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(":(")
else:
    print("Yay!")

Submission status: Accepted

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

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

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

if count >= 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 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 = []

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

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())
ls=[a,b,c,d,e]
for i in range(len(ls)):
    for j in range(len(ls)-i):
        if ls[i] - ls[j] > k:
            print(':(')
            break
    else:
        continue
    break
else:
    print('Yay!')

Submission status: Accepted

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

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

# print(a)

flg = False

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

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-

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


if k >= b-a and k >= c-a and k >= d-a and k >= e-a and k >= c-b and k>= d-b and k >= e-b and k >= d-c and k >= e-c and k>= e-d:
    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())
long=0

towers=[a,b,c,d,e]
for n in towers:
    for m in towers:
        if m-n > k:
            long=1
            
if long==1:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

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

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

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

if(f == 0):
    print("Yay!")
else:
    print(":(")
"""
num[1]-num[0]
num[2]-num[0]
num[3]-num[0]
num[4]-num[0]

num[2]-num[1]
num[3]-num[1]
num[4]-num[1]

num[3]-num[2]
num[4]-num[2]

num[4]-num[3]
"""

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
q = int(input())
 
f=e-d
g=e-c
h=e-b
i=e-a
j=d-c
k=d-b
l=d-a
m=c-b
n=c-a
o=b-a

 
 
if f<=q and g<=q and h<=q and i<=q and j<=q and k<=q and l<=q and m<=q and n<=q and o<=q:
  print("Yay!")
 
else:
  print(":(")

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

flag = 0

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:
anten=[]
for i in range(5):
    anten.append(int(input()))
k=int(input())

flag=False
for i in range(5):
    for j in range(5-i-1):
        p=anten[i]
        q=anten[i+j+1]
        if q-p>k:
            flag=True
if flag:
    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(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
import sys
import itertools

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

for a, b in itertools.combinations(antennas, 2):
  if b - a > k:
    print(':(')
    sys.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())

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

Submission status: Accepted

Solution code:
import sys
nyan = []

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

for j in range(5):
  for i in range(5):
    if (nyan[4-j] - nyan[i]) > nyan[5]:
      print(":(")
      sys.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())

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

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
a = []
for i in range(6):
  a.append(int(input()))
  
f = 0
for i in range(5):
  for j in range(5):
    if j > i:
      if a[j] - a[i] > a[5]:
        f = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

coord = [a, b, c, d, e]
flag = False
for i in range(len(coord)):
    for j in range(len(coord)):
        dis = abs(coord[i] - coord[j])
        if dis > k :
            flag = True
if flag == True :
    print(":(")
else :
    print("Yay!")

Submission status: Accepted

Solution code:
a = list(range(5))
a[0] = int(input())
a[1] = int(input())
a[2] = int(input())
a[3] = int(input())
a[4] = int(input())
k = int(input())
c = 0
for i in range(4):
    for j in range(1+i, 5):
        if(abs(a[i]-a[j])>k):
            c+=1
if(c>0):
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

Solution code:
m_list=list(map(int, [input() for i in range(6)]))
flag=0

for i in range(5):
        for j in range(5):
                if abs(m_list[i]-m_list[j])>m_list[5]:
                        flag=1
        
        
if flag==1:
        print(":(")  
else:
        print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(4):
    for j in range(i+1, 5):
        if abs(L[i] - L[j]) > k:
            print(":(")
            break
    else:
        continue
    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())
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:
import numpy as np

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


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

Submission status: Accepted

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

def an (a,b,c,d,e,k) :
  for i in {b,c,d,e} :
    if i-a>k :
      return ":("
  for i in {c,d,e} :
    if i-b>k :
      return ":("
  for i in {d,e} :
    if i-c>k :
      return":("
  for i in {e} :
    if i-d>k :
      return ":("
  return "Yay!"


ans = an(a,b,c,d,e,k)
print ans

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

Solution code:
a = int(input())
for i in range(3):
    _ = 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())
num = [a,b,c,d,e]
count = 0
flg = True
for i in range(5):
    for j in range(i,5):
        if num[j] - num[i] > k:
            print(":(")
            flg = False
            break
    if not flg:
        break
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import sys

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

for i in range(5):
    for j in range(i + 1, 5):
        distance = spots[j] - spots[i]
        if (distance > k):
            print(":(")
            sys.exit()

print("Yay!")

Submission status: Accepted

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

k = int(input())

for i in range(5):
    for j in range(5):
        if antenna_points[j] - antenna_points[i] > k:
            print(":(")
            sys.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:
num = []

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

k = int(input())

bool = True

for i in range(4,0,-1):
  for j in range(i):
    if (num[i] - num[j]) > k:
      bool = False
    else:
      continue
    break
    
if bool:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
temp = []

a = int(input())
temp.append(a)
b = int(input())
temp.append(b)
c = int(input())
temp.append(c)
d = int(input())
temp.append(d)
e = int(input())
temp.append(e)
k = int(input())
ans = 'Yay!'
for i in range(len(temp)):
    if i==len(temp):
        break
    for j in range(len(temp)):
        if j==len(temp):
            break       
        if i==j:
            continue
        if i>j:
            if temp[i]-temp[j]>k:
                ans = ':('
                break
        else:
            if temp[j]-temp[i]>k:
                ans = ':('
                break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list = [int(input()) for i in range(5)]
k = int(input())
n = 1
def calc(list):
  for i in range(0,4):
    for j in range(1,5):
      if list[j]-list[i] >k:
        return ':('
      else:
        continue
  return 'Yay!'
 
print(calc(list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
arr=[int(input()) for i in range(5)]
k=int(input())
 
for i in range(len(arr)):
    for j in range(len(arr)-i-1):
        if abs(arr[i] - arr[i+j+1]) > k:
            print(":(")
            sys.exit()
 
print("Yay!")

Submission status: Accepted

Solution code:
args = {}
l = ["a", "b", "c", "d", "e", "k"]
for i in range(len(l)):
    args[l[i]] = int(input())
for i in range(len(l) - 1):
    j = 5-i
    for m in range(len(l) - 2):
        n = j - (m+1)
        if n <= 0:
            continue
        if args[l[j-1]] - args[l[n-1]] > args["k"]:
            print(':(')
            exit()
print("Yay!")

Submission status: Accepted

Solution code:
#coding:utf-8

coord = []
for i in range(5):
    coord.append(int(input()))

k = int(input())


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

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

for f in antenas:
    for d in antenas:
        if abs(f-d) > k:
            print(":(")
            sys.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())



if b-a > k:
    print(':(')
elif c -b > k:
    print(':(')
elif d -c > k:
    print(':(')
elif e -d > k:
    print(':(')
elif c -a > k:
    print(':(')
elif d -a > k:
    print(':(')
elif d -b > k:
    print(':(')
elif e -a > k:
    print(':(')
elif e -b > k:
    print(':(')
elif e -c > 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]
lst.sort()

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

Submission status: Accepted

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

s = [b-a, c-a,d-a,e-a,b-c,b-d,b-e,d-c,d-e,e-d]
ans = "Yay!"
for ss in s:
  if ss > k:
    ans = ":("
print(ans)

Submission status: Accepted

Solution code:
all_list = [int(input()) for _ in range(5)]
k = int(input())
count = 0
for i in range(5):
    for j in range(i+1,5):
        result = abs(all_list[i] - all_list[j])
        if k < result:
            count += 1
if count == 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())
s=[a,b,c,d,e]
f=e-a
if(f<=k):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
import sys


def main():
    inp = [int(line)  for line in sys.stdin.readlines()]
    k = inp.pop(len(inp) - 1)
    #sys.stdin.readline()
    #line = sys.stdin.readline()

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

if __name__ == '__main__':
    sys.exit(main())

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:
error_flag = 0;                                                     
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if b-a>k:error_flag=1
if c-a>k:error_flag=1
if d-a>k:    error_flag=1
if e-a>k:error_flag=1
if c-b>k:error_flag=1
if d-b>k:error_flag=1
if e-b>k:error_flag=1
if d-c>k:error_flag=1
if e-c>k:error_flag=1
if e-d>k:error_flag=1

if error_flag == 0:
    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 (max(A) - min(A) > k):
    print(':(')
    exit()

print('Yay!')

Submission status: Accepted

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

i=0
j=0
flag=0

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



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

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

ba = b - a
ca = c - a
da = d - a
ea = e - a
cb = c - b
db = d - b
eb = e - b
dc = d - c
ec = e - c
ed = e - d

if ba > k or ca > k or da > k or ea > k or cb > k or db > k or eb > k or dc > k or ec > k or ed > 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 = [a, b, c, d, e]
ans = 'Yay!'
for i, j in itertools.combinations(A, 2):
    if abs(i - j) > k:
        ans = ':('
        
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(":(")
else:
  print("Yay!")

Submission status: Accepted

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

k = int(input())

b = True
for i in range(4):
    for j in range(4-i):
        # print(str(s[i+j+1])+"-"+str(s[i])+":" + str(s[i+j+1]-s[i]))
        if s[i+j+1]-s[i] > k:
            b = False
            break

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

Submission status: Accepted

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

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


main()

Submission status: Accepted

Solution code:
from sys import stdin

antennas = [int(stdin.readline().rstrip()) for _ in range(5)]
k = int(stdin.readline().rstrip())
farest = antennas[4]

print(':(' if any(farest - antenna > k for antenna in antennas) else 'Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

antennas = []
antennas.append(int(input()))
antennas.append(int(input()))
antennas.append(int(input()))
antennas.append(int(input()))
antennas.append(int(input()))
k = int(input())

antennas = sorted(antennas)
if antennas[4] - antennas[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())

antenas = [a, b, c, d, e, k]
ans_str = 'Yay!'
for i in range(len(antenas)-1):
    ans = 0
    for j in range(len(antenas)-i-1):
        ans = antenas[i]-antenas[i+j+1]
        if ans < -1:
            ans *= -1
        if ans > k:
            ans_str = ':('
            break
    if ans > k:
        ans_str = ':('
        break

            
    
# 出力
print(ans_str)

Submission status: Accepted

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

min = min([a,b,c,d,e], key=int)
max = max([a,b,c,d,e], key=int)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
antena = []
for i in range(5):
    antena.append(int(input()))
k = int(input())
ans = False

for i in range(5):
    for j in range(5):
        if antena[i] - antena[j] > k:
            ans = True
            break

if ans == True:
    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())
arr = [a,b,c,d,e]
bool = True

for i in range(len(arr)):
  for j in range(len(arr)):
    if i != j and abs(arr[i] - arr[j]) > k:
      bool = False
      break;
      
if bool:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# input
listA = []
while True:
    try:
        listA.append(int(raw_input()))
    except:
        break;

a = listA[0]
b = listA[1]
c = listA[2]
d = listA[3]
e = listA[4]
k = listA[5]

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 (e-c <= k) and (d-c <= k) \
   and (e-d <= 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())
flag = 0
if k < e - a:
  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:
#!/usr/bin/env python3

import re

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

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

Submission status: Accepted

Solution code:

li2 = []
cnt = 1
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
li = [a,b,c,d,e]
k = int(input())
for y in li:
    li2.append(y-a)
    li2.append(y-b)
    li2.append(y-c)
    li2.append(y-d)
    li2.append(y-e)


for x in li2:
    if x < 0:
        x = -x
    if x > k:
        cnt = 1
        break
        
    else:
         cnt = 0
if cnt == 0:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

for i in range(5):
    j=5
    while j>i:
        if (li[j]-li[i])>li[5]:
            isexist=True
        j-=1

if isexist==True:
    print(":(")
else:
    print("Yay! ")

Submission status: Accepted

Solution code:
abcde = list()
ans = "Yay!"
flag = True
for i in range(6):
    abcde.append(int(input()))

for i in range(5):
    for j in range(5):
        if abs(abcde[i] - abcde[j]) > abcde[5]:
            ans = ":("
            flag = False
            break
    if flag != True: break
print(ans)

Submission status: Accepted

Solution code:
import itertools

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    position = [a, b, c, d, e]
    test_cases = list(itertools.combinations(position, 2))

    is_all_communication_possible = True

    for e in test_cases:
        position1 = e[0]
        position2 = e[1]

        if position2 - position1 > k:
            is_all_communication_possible = False

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

Submission status: Accepted

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

for i in range(4):
    if A[4]-A[0]>A[5]:
        print(":(")
        exit()


print("Yay!")

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

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

flag = False

for p in l:
  for q in l:
    if abs(p-q) > k:
      flag = True

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

Submission status: Accepted

Solution code:
import sys
nums = [int(input()) for _ in range(5)]
k = int(input())
for i in nums:
  for j in nums:
    if abs(i-j) > k:
      print(":(")
      sys.exit()
print("Yay!")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
A = input()
B = input()
C = input()
D = input()
E = input()
K = input()

if B-A<=K and C-A<=K and D-A<=K and E-A<=K and C-B<=K and D-B<=K and E-B<=K and D-C<=K and E-C<=K and E-D<=K:
  print "Yay!"
else:
  print ":("

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

result = 0
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
list_in = [a,b,c,d,e]
list_in = sorted(list_in)

for i in itertools.permutations([a,b,c,d,e], r=2):
    i = sorted(i)
    if i[1]-i[0] > k:
      result = 1

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

Submission status: Accepted

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

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

print("Yay!")

Submission status: Accepted

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

import itertools
i = 0
for v in itertools.combinations(antenna, 2):
    if abs(v[0]-v[1]) > d:
        print(":(")
        break
    else:
        pass
    i += 1
if i == 10:
    print("Yay!")