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:
#ABC123A
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:
p = []
for i in range(5):
    p.append(int(input()))
k = int(input())
if max(p) - min(p) > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
pos = [int(input()) for _ in range(5)]
k = int(input())
res=True
for i in range(4):
    if pos[i+1]-pos[i]>k:
        res=False
if pos[-1] - pos[0]<=k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
a, b, c, d, e, k = map(int, [input() for i in range(6)])
antena = [a,b,c,d,e,k]
# print(antena[0])
for i in range(0, 4):
    for j in range(i+1, 5):
        if int(antena[j])-int(antena[i])> int(antena[5]):
            print(":(")
            exit()
        else:
            flag = False
            continue

print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

message = 'Yay!'
for i in range(5):
    for l in location[i:]:
        if (l - location[i]) > k:
            message = ':('

print(message)

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]
flag=True
 
for i in range(5):
  for j in range(5):
    if array[i]-array[j] > k:
      flag=False
      print(":(")
      break
  if not flag:
    break
      
if flag:
  print("Yay!")

Submission status: Accepted

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

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=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:
n = 6;
a = [input() for i in range(n)];
 
k = a[-1];
ans = "Yay!";
 
for i in range(n-1):
  for j in reversed(range(n-1)):
    if k < a[i] - a[j]:
      ans = ":( ";
      break;
print ans;

Submission status: Accepted

Solution code:
import sys

point = []

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

k = int(input())


for i in range(0, len(point)):
  for j in range(i + 1, len(point)):
    if abs(point[i] - point[j]) > k:
      print(":(")
      sys.exit()



print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations
a = [int(input()) for _ in range(5)]
k = int(input())
for b in combinations(a, 2):
    if abs(b[0]-b[1]) > k:
        exit(print(':('))
print('Yay!')

Submission status: Accepted

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

if b-a>k:
  print(':(')
elif v-a>k:
  print(':(')
elif d-a>k:
  print(':(')
elif e-a>k:
  print(':(')
elif v-b>k:
  print(':(')
elif d-b>k:
  print(':(')
elif e-b>k:
  print(':(')
elif d-v>k:
  print(':(')
elif e-v>k:
  print(':(')
elif e-d>k:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
a = []

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

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

Submission status: Accepted

Solution code:
max_num = 0
a = int(input())
for i in range(3):
    input()
e = int(input())
k = int(input())
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())

L = [A,B,C,D,E]

for i in range(len(L)):
    for j in range(i+1,len(L)):
        if(abs(L[i]-L[j])>K):
            print(":(")
            exit()


print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B, C, D, E, K):
    a = A, B, C, D, E
    for p, q in combinations(a, r=2):
        if abs(p-q) > K:
            return ':('


    return 'Yay!'


def main():
    A = read_int()
    B = read_int()
    C = read_int()
    D = read_int()
    E = read_int()
    K = read_int()

    print(slv(A, B, C, D, E, K))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
t = [0] * 5
t[0] = int(input())
t[1] = int(input())
t[2] = int(input())
t[3] = int(input())
t[4] = int(input())
k = int(input())

def check():
    if t[4] - t[0] > k:
        return ':('
    return 'Yay!'

print(check())

Submission status: Accepted

Solution code:
a_e = [int(input()) for i in range(5)]
k = int(input())
if (a_e[-1] - a_e[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:
l = [int(input()) for _ in range(5)]
k = int(input())
print('Yay!' if k >= max(l) - min(l) else ':(')

Submission status: Accepted

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

if list[4] - list[0] <= list[5]:
  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:
pos = [int(input()) for i in range(5)]
k = int(input())
if pos[4] - pos[0] > k: print(":(")
else: print("Yay!")

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc123/tasks/abc123_a

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

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


ans = 'Yay!'
for i in range(0, len(antenna)-1):
    current = antenna[i]
    for n in range(i+1, len(antenna)):
        if abs(current - antenna[n]) > 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())

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

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

Submission status: Accepted

Solution code:
#-*-coding:utf8;-*-
#qpy:3
#qpy:console
antenas = []
for i in range(5):
    antenas.append(int(input()))
k = int(input())
if max(antenas)-min(antenas)>k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
# A,Eが直接通信できれば全てのアンテナ間で通信ができる
import numpy as np
A = np.zeros(6)
for i in range(6):
    A[i] = 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())

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

Submission status: Accepted

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

l = [a, b, c, d, e]
d = list()

for i, x in enumerate(l[:-1]):
    l2 = l[i+1:]
    for y in l2:
        d.append(y-x)

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

Submission status: Accepted

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

t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) > int(s):
            t = 1
        elif int(i) - int(k) > int(s):
            t = 1

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

Submission status: Accepted

Solution code:
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
h=c-b
i=d-b
j=e-b
k=f-b
l=d-c
m=e-c
n=f-c
o=e-d
p=f-d
q=f-e
r=int(input())
s=":("
if r<h:
  print(s)
elif r<i:
  print(s)
elif r<j:
  print(s)
elif r<k:
  print(s)
elif r<l:
  print(s)
elif r<m:
  print(s)
elif r<n:
  print(s)
elif r<o:
  print(s)
elif r<p:
  print(s)
elif r<q:
  print(s)
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 (max(a,b,c,d,e) - min(a,b,c,d,e) <= 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())

def main():
    if E - A > K:
        print(":(")
    else:
        print("Yay!")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder_BEGINNERS_Contest123-A
#  TODO https://atcoder.jp/contests/abc123/tasks/abc123_a

def solveProblem(a,b,c,d,e,k):
	if k < b - a :return ":("
	if k < c - a :return ":("
	if k < d - a :return ":("
	if k < e - a :return ":("
	if k < c - b :return ":("
	if k < d - b :return ":("
	if k < e - b :return ":("
	if k < d - c :return ":("
	if k < e - c :return ":("
	if k < e - d :return ":("
	return "Yay!"


if __name__ == '__main__':
	a = int(input().strip())
	b = int(input().strip())
	c = int(input().strip())
	d = int(input().strip())
	e = int(input().strip())
	k = int(input().strip())
	solution = solveProblem(a,b,c,d,e,k)
	print("{}".format(solution))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
 
number1 = [a, b, c, d, e]
number2 = [b, c, d, e]
count = 0
 
for num1 in number1:
  for num2 in number2:
    if abs(num1 - num2) <= k:
      count += 1
if count == 20:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lis = [int(input()) for _ in range(5)]
k = int(input())
l = sorted(lis)[0], sorted(lis)[-1]
print([':(', 'Yay!'][(l[1] - l[0]) <= k])

Submission status: Accepted

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

a=int(input())
count=0

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

Submission status: Accepted

Solution code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
if int(e) - int(a) <= int(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())
x = 0
y = 0

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



for i in range(5):

    for j in range(i+1, 5):
        result = antena[j] - antena[i]
        

        if result > k:
            x += 1


        else:
            y += 1
            


if x >= 1 and y < 10:
    print(":(")

elif x == 0 and y == 10:
    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())

ab = b-a
ac = c-a
ad = d-a
ae = e-a
bc = c-b
bd = d-b
be = e-b
cd = d-c
ce = e-c
de = e-d

if ab <= k and ac <= k and ad <= k and ae <= k and bc <= k and bd <= k and be <= k and cd <= k and ce <= k and de <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
array = []
output = "Yay!"
for i in range(5):
  n = int(input())
  array.append(n)

k = int(input())

for i in range(5):
  for j in range(i+1,5):
    if abs(array[i]-array[j]) > k:
      output = ":("
          
print(output)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

x = []

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

k = int(input())

if max(x) - min(x) > 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, b, c, d, e, k = [int(input()) for _ in range(6)]


i = e-a

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

Submission status: Accepted

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

items = [int(a), int(b), int(c), int(d), int(e)]
flg = False
for i in range(len(items)):
    for j in range(i, len(items)):
        if items[j] - items[i] > k:
            flg = True
        if flg:
            break
    if flg:
        break
if flg:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

for x in range(4):
  for y in range(4):
    s = 0
    s = int(l[x]) - int(l[y+1])
    if(s<0):
      s = -s
    if(k < s):
      print(":(")
      break
    if(x==3 & y==3):
      print("Yay!")
  else:
    continue
  break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 21:07:41 2019

@author: qqwx2_000
"""
import itertools

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

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

distance = []

for i in itertools.combinations(coordinate, r=2):
    com = i
    d = com[1] - com[0]
    distance.append(d)
k_up = [i for i in distance if k < i]

if len(k_up) >= 1: 
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

bar = inputs[:-1]
n = 5
k = inputs[-1]

ok = True

for i in range(n):
    for j in range(n):
        # print("i: {}, j:{}".format(i,j))
        if abs(bar[i] - bar[j]) > k:
            ok = False
            break
            

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
    crd_antenna=[0]*5
    for i in range(5):
        crd_antenna[i]=int(input())
    dist_limit = int(input())
    bool = "True"
    for i in range(0,5):
        if bool == "False":
            break
        for j in range(i+1,5):
            if crd_antenna[j]-crd_antenna[i] > dist_limit:
                bool = "False"
                print(":(")
                break
            else:
                bool = "True"
    if bool == "True":
        print("Yay!")

solve()

Submission status: Accepted

Solution code:
l = []
for i in range(5):
    l.append(int(input()))
l.sort()
k = int(input())
ans = l[-1]-l[0]-k
if ans>0:
    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 < abs(e-a):
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
ls = []
for i in range(5):
  ls.append(int(input()))
k = int(input())
a = []
for i in range(5):
  for j in range(i+1, 5):
    a.append(abs(ls[i] - ls[j]) <= k)
if all(a):
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
de = e - d
ce = e - c
cd = d - c
be = e - b
bd = d - b
bc = c - b
ae = e - a
ad = d - a
ac = c - a
ab = b - a
distance = [ab, ac, ad, ae, bc, bd, be, cd, ce, de]
output = []
ok = 'Yay!'
bad = ':('
for i in distance:
    if i > k:
        output.append(bad)
    elif i <= k:
        output.append(ok)
if bad in output:
    print(bad)
elif ok in output:
    print(ok)

Submission status: Accepted

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

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

print("Yay!")

Submission status: Accepted

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

for i in array:
  for j in array:
    if abs(i-j) > k:
      print(":(")
      exit()
print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 21:35:04 2019

@author: yuta
"""

ABCDE = [int(input()) for i in range(5)]
K = int(input())

def main(x,k):
    if max(x) - min(x) <= k:
        print("Yay!")
    else:
        print(":(")
main(ABCDE,K)

Submission status: Accepted

Solution code:
a = 0
b = 0
n = 0
k = 0
c = 0
list = []
i = str(input())+" "
for n in range(4):
 i += str(input())+" "
k = int(input())
list = i.split()
for n in range(0,4):
 a = int(list[n])
 b = int(list[n+1])
 if b - a <= k:
  c += 1
a = int(list[0])
b = int(list[4])
if b - a > k:
 c = 0
if c == 4:
 print("Yay!")
else:
 print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,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 list(map(int, sys.stdin.readline().split()))
def LLI(): return [tuple(map(int, l.split())) for l in sys.stdin]
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 S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a = sorted([I() for _ in range(5)])
    k = I()
    if a[-1] - a[0] > k:
        return ':('

    return 'Yay!'

print(main())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Input
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

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

count = 0
num = len(list) - 1
for ii in range(num):
    for hh in range(num - (int(ii) - 1)):
        if list[num - ii] - list[ii] > k:
            count += 1

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

Submission status: Accepted

Solution code:
List=[int(input()) for i in range(5)]
k = int(input())
sList=sorted(List)
if sList[4]-sList[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())
l = [a,b,c,d,e]
max = max(l)
min = min(l)
if max - min <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
box=[]
for i in range(6):
  box.append(int(input()))
flag=0
if box[4]-box[0]>box[5]:
    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())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
result = 0
for i in range(len(data)):
    if data[i][0] < data[i][1]:
        if data[i][1] - data[i][0] <= k:
            result +=1
    else:
        if data[i][0] - data[i][1] <= k:
            result +=1
if result == len(data):
    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())


lis = [e,d,c,b,a]
lis2 = [a,b,c,d,e]

yay_flg = 0
exist_flg = 0

for x in lis:
  for j in lis2:
    if x == j:
      break
      
    if x - j <= k:
      yay_flg = 1
      
    if x - j > k:
      exist_flg = 1
      
if yay_flg == 1 and exist_flg == 0:
  print("Yay!")
  
else:
  print(":(")

Submission status: Accepted

Solution code:
x = []
for i in range(5):
        x.append(int(input()))
k = int(input())
a = x[0]
n = True
for i in x:
        b = abs(a-i)
        if b > k:
                n = False
        else:
                None
if not n:
        print(":(")
else:
        print("Yay!")

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(5)]
k = int(input())
flag = False
for i in range(5):
    for j in range(5):
        if abs(a[i] - a[j]) > k:
            flag = True
print("Yay!" if flag == False else ":(")

Submission status: Accepted

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

Submission status: Accepted

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

if e - a > k :
  print(":(")
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())

distance_list =[(b-a),(c-a),(d-a),(e-a),(c-b),(d-b),(e-b),(d-c),(e-c),(e-d)]

if max(distance_list) > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 21:22:08 2019

@author: Tabe
"""

pos = list()
for i in range(5):
    pos.append(int(input()))

k = int(input())
hh = False

for index, val in  enumerate(pos):
    if hh == True:
        break;
    
    if index == 4:
        print("Yay!")
        break
    
    for i in  range(5):
        if abs(pos[index] - pos[i]) <= k:
            pass
        else:
            print(":(")
            hh = True
            break

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 (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, k]

b_1 = (b - a  <= k)
c_1 = (c - a <= k)
d_1 = (d - a <=k)
e_1 = (e - a <= k)

list_1 = [b_1, c_1, d_1, e_1]

count = 0
kotae = []
for i in range(len(list_1)):
    if list_1[i] == False:
        count = count + 1
if count > 0:
   kotae.append(0)

list_2 = []
for i in range(2, 5):
    list_2.append( list[i] - b <= k)
 

unko = 0
for i in range(len(list_2)):
    if list_2[i] == False:
        unko = unko + 1
if unko > 0:
    kotae.append(0)

list_3 = []
for i in range(3, 5):
    list_3.append( list[i] - c <= k)
    
count = 0
for i in range(len(list_3)):
    if list_3[i] == False:
        count = count + 1
if count > 0:
    kotae.append(0)

v = (e - d <= k)
if v == 0:
   kotae.append(0)

if (0 in kotae) == 1:
    print (':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
#!/usr/bin/python

import itertools

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

    for v in  itertools.combinations(anthenas, 2):
        d = abs(v[1] - v[0])
        if d > k:
            msg = ':('
            break
        msg = 'Yay!'
    
    print(msg)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
raw = raw_input()
a = int(raw)
raw = raw_input()                                  
b = int(raw)
raw = raw_input()                                  
c = int(raw)
raw = raw_input()                                  
d = int(raw)
raw = raw_input()                                  
e = int(raw)
raw = raw_input()                                  
k = int(raw)
                                                                                                       
if e - a > k:
    print ':('
else:                                                                                                  
    print 'Yay!'

Submission status: Accepted

Solution code:
x = [int(input()) for i in range(6)]
if x[4] - x[0] <= x[-1]: 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 b - a > k:
    print(":(")
elif c - a > k:
    print(":(")
elif d - a > k:
    print(":(")
elif e - a > k:
    print(":(")
elif c - b > k:
    print(":(")
elif d - b > k:
    print(":(")
elif e - b > k:
    print(":(")
elif d - c > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import numpy as np
n=6
a=[int(input()) for i in range(n)]
dero=np.zeros((25,2))
for i in range(5):
  for j in range (5):
    dero[i*5+j][0]=a[j]-a[i]
    dero[i*5+j][1]=a[5]
frag=0
for i in range(25):
  if dero[i][0]>dero[i][1]:
    frag=1
if frag==0:
  print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
def main(a):
  for i in range(4):
    for j in range(i+1, 5):
      if a[j] - a[i] > k:
        print(":(")
        return 
  else :
    print("Yay!")
    return

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