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 -*-

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

reach = True

for i in range(5):
    for j in range(5):
        if antenna[i]-antenna[j] > k:
            reach = False

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

Submission status: Accepted

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

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


if ab > k or ac > k or ad > k or ae > k or bc > k or bd > k or be > k or cd > k or de > 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:
# coding: utf-8

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

for x in L:
	for y in L:
		if k<abs(x-y):
			print ":("
			quit()
else:
	print "Yay!"

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import itertools


def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]


def solve():
    a = makeInt(input())
    b = makeInt(input())
    c = makeInt(input())
    d = makeInt(input())
    e = makeInt(input())
    l = [a, b, c, d, e]
    k = makeInt(input())
    flag = False
    for i in range(len(l)):
        for j in range(len(l)-1):
            if abs(l[i] - l[j+1]) > k:
                flag = True
    if flag:
        return ":("
    else:
        return "Yay!"


def main():
    answer = solve()
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
ABCDE = []
for _ in range(5):
  ABCDE.append(int(input()))
K = int(input())
if max(ABCDE) - min(ABCDE) > 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())

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

k = int(input())

first = ant[0]
for i in reversed(range(1, 5)):
	if ant[i] -  first > k:
		print (":(")
		quit()

print ("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def check(pos):
    for a in pos:
        for b in pos:
            if abs(a - b) > k:
                return False
    return True

pos = [None] * 5
for i in range(0, 5):
    pos[i] = int(input())
k = int(input())

print("Yay!" if check(pos) else ":(")

Submission status: Accepted

Solution code:
from sys import stdin
import itertools

data=[]
for i in range(5):
    data.append(int(input()))
k=int(stdin.readline().rstrip())

flag=0
for j in list(itertools.product(data,repeat=2)):
    if abs(j[0]-j[1]) > k:
        flag=1
if flag==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())
data_list = [a,b,c,d,e]
if max(data_list)-min(data_list)<=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())
lis = [int(abs(a-b)),int(abs(a-c)),int(abs(a-d)),int(abs(a-e)),int(abs(b-c)),int(abs(b-d)),int(abs(b-e)),int(abs(c-d)),int(abs(c-e)),int(abs(d-e))]
tes = 0
for item in lis:
    if item > k:
        tes += 1
if tes == 0:
    print('Yay!')
else:
    print(":(")

Submission status: Accepted

Solution code:
import sys

def is_ok(a,b, k):
    return (a - b) * (a-b) <= k * k

def main():

    points = []

    for line in sys.stdin:
        line = line.rstrip()
        a = int(line)
        points.append(a)


    s = points[5]
    for i in range(5):
        p = points[i]
        for k in range(i+1, 5):
            q = points[k]

            if not is_ok(p, q, s):
                print(':(')
                return 0

    print('Yay!')
    return 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
x = [a,b,c,d,e]
k = int(input())
dis = []
for i in range(5):
  for j in range(5):
    if i == j:
      continue
    else:
      dis.append(abs(x[i]-x[j]))
for d in dis:
  if d>k:
    print(":(")
    exit(0)

print("Yay!")

Submission status: Accepted

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

pole = [A,B,C,D,E]
sw = 0
for i in range(5):
    if sw == 1:
        break
    for j in range(5):
        if pole[i]-pole[j] > k:
            print(":(")
            sw = 1
            break
if sw == 0:
    print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 'Yay!'

for i in range(5):
  for j in range(i,5):
    if abs(a[i] - a[j]) > k:
      ans = ':('

print(ans)

Submission status: Accepted

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

ok = True

for i in range(5):
    for j in range(i+1, 5):
        if antennas[j] - antennas[i] > k:
            ok = False

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

Submission status: Accepted

Solution code:
l = [int(input()) for _ in range(5)]
from itertools import combinations
p = list(combinations(l, 2))
k = int(input())
print('Yay!' if all([abs(p[i][0] - p[i][1]) <= k for i in range(len(p) - 1)]) else ':(')

Submission status: Accepted

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

Submission status: Accepted

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

mi = min(a, b, c, d, e)
ma = max(a, b, c, d, e)

ans = 'Yay!' if ma - mi <= k else ':('

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

Submission status: Accepted

Solution code:
ant =[]
ind = 0

for i in range(5):
    ant.append(int(input()))
k = int(input())

for i in range(5):
    for j in range(i,5):
        if ant[j] - ant[i] > k:
            ind += 1
if ind <= 0:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

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

Submission status: Accepted

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

flgs = [abs(antennas[i] - antennas[j]) <= k
             for i in range(len(antennas)-1) 
             for j in range(i+1,len(antennas))
            ]

print("Yay!" if all(flgs) else ":(")

Submission status: Accepted

Solution code:
import numpy as np

import sys
sys.setrecursionlimit(1000000)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = 1

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

for i in range(5):
    for j in range(5):
        if (aa[i]-aa[j]>k) or (aa[i]-aa[j]<-1*(k)):
            flag = 0

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

Submission status: Accepted

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

t=e-a

if t > k:
	print(':(')
else:
	print('Yay!')

Submission status: Accepted

Solution code:
a  = list()
for i in range(0,6):
    a.append(int(input()))

if a[5] < a[4]-a[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:
import sys
l = [int(input()) for i in range(5)]
k = int(input())
for i in range(5):
    for j in range(5):
        if abs(l[i]-l[j]) > k:
            print(":(")
            sys.exit()
else:
    print("Yay!")

Submission status: Accepted

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

if e-d <= K and e-c <= K and e-b <= K and e-a <= K and d-c <= K and d-b <= K and d-a <= K and c-b <= K and c-a <= K and b-a <= K:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

line=[b-a,c-b,d-c,e-d,c-a,d-b,e-c,d-a,e-b,e-a]

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

Submission status: Accepted

Solution code:
lis = []
count = 0

for i in range(5):
  a = int(input())
  lis.append(a)
  
k = int(input())
for x in lis:
  for y in lis:
    if x-y>k:
      count += 1
      
if count != 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())
abc = [a,b,c,d,e]
ans = 0
flag = 0
for i in range(5):
    for j in range(i,5):
        ans = abc[j]-abc[i]
        if ans <= k:
            continue
        else:
            flag = 1
            break
if flag == 1:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

ans = 'Yay!'
for i in range(5):
    for j in range(5):
        if abs(a[i] - a[j]) > k:
            ans = ':(' 

print(ans)

Submission status: Accepted

Solution code:
def main():
  ps = list(map(int, [input() for _ in range(5)]))
  k = int(input())
  for i in range(len(ps)):
    for j in range(i, len(ps)):
      if abs(ps[i] - ps[j]) > k:
        print(':(')
        return
  print('Yay!')
  
main()

Submission status: Accepted

Solution code:
#coding:utf-8
A = [0] * 6
for i in range(len(A)):
    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 e - a > k:
    print(":(")
elif d - a > k or e - b > k:
    print(":(")
elif c - a > k or d - b > k or e - c > k:
    print(":(")
elif b - a > k or c - b > k or d - c > k or e - d > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

f = True
for A, B in itertools.combinations(a, 2):
    if abs(A - B) > k:
        f = False

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

Submission status: Accepted

Solution code:
dis = [int(input()) for i in range(5)]
k = int(input())
if (dis[-1]-dis[0])>k:
  print(':(')
  exit()
    
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 e - a > k:
    print(':(')
    exit()

if e - b > k:
    print(':(')
    exit()

if e - c > k:
    print(':(')
    exit()

if e - d > k:
    print(':(')
    exit()

if d - a > k:
    print(':(')
    exit()

if d - b > k:
    print(':(')
    exit()

if d - c > k:
    print(':(')
    exit()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/04/06
# AtCoder Beginner Contest 123 - A

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

# Calc
if e - a > k:
    ans = ":("
else:
    ans = "Yay!"

# Output
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:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

dis = int(input())

if(e-a <= dis):
	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 a[j] - a[i] > k:
            ans = False
            break
    if not ans:
        break

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

Submission status: Accepted

Solution code:
l = [int(input()) for k in range(6)]
for i in range(5):
    for j in range(5):
        if i==j:
            continue
        else:
            if abs(l[i]-l[j])>l[5]:
                print(':(')
                exit()
print('Yay!')

Submission status: Accepted

Solution code:
minl = int(input())
maxl = minl
for i in range(4):
  a = int(input())
  minl = min(minl, a)
  maxl = max(maxl, a)
k = int(input())
print('Yay!' if maxl - minl <= k else ':(')

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A=[INT() for i in range(5)]
K=INT()

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l.sort()

is_ok = True
for i in range(5):
    for j in range(5):
        if abs(l[i] - l[j]) > k:
            is_ok = False 
            break
    if is_ok == False:
        break

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

Submission status: Accepted

Solution code:



# いっこ入力
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
k =int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

lis.sort()

if lis[4]-lis[0]>k:
    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:
a = [int(input()) for i in range(5)]
k = int(input())
result = 0
for i in range(5):
    p = a[i]
    for j in range(4):
        q = a[j]
        if a != j and abs(p - q) > k:
            result = 1
if result == 1:
    print(':(')
else:
    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())
A = [a, b, c, d, e]
if max(A) - min(A) > k:
    print(":(")
    sys.exit(0)
print("Yay!")

Submission status: Accepted

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

from itertools import combinations

import sys

X = []
for _ in range(5):
    X.append(int(input()))
K = int(input())
    
for a, b in combinations(X, 2):
    if abs(a - b) > 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())

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

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

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

Submission status: Accepted

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

check = 0
if abc[4] - abc[0] > k:
    check = 1

if check == 1:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:

N = 5
contenas = [int(input()) for i in range(N)]
k = int(input())

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

Submission status: Accepted

Solution code:
import sys
import io
import math
import re

datalist = input().split()
data_a = int(datalist[0])
datalist = input().split()
datalist = input().split()
datalist = input().split()
datalist = input().split()
data_b = int(datalist[0])
datalist = input().split()
data_c = int(datalist[0])

if data_b -data_a <= data_c:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
p=[int(input())for _ in range(5)]
l=int(input())
for s in p[::-1]:
  if s-p[0]>l:
    print(':(');exit()
print('Yay!')

Submission status: Accepted

Solution code:
a = int(input())

for i in range(4):
	b = int(input())

k = int(input())

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

Submission status: Accepted

Solution code:
min_n = 124
max_n = -1

for _ in range(5):
    temp = int(input())
    min_n = min(min_n,temp)
    max_n = max(max_n,temp)

distance = int(input())
if max_n-min_n > distance:
    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())
judge = all([abs(i1 - i2) <= k for (i1, i2) in list(itertools.combinations([a,b,c,d,e],2))])
if judge:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
input = sys.stdin.readline

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

k = int(input())

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
m = max([a, b, c, d, e])
n = min([a, b, c, d, e])
print('Yay!' if k >= (m - n) else ':(')

Submission status: Accepted

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

flag = 'Yay!'
antenas = [a, b, c, d, e]
for i in range(5):
    for j in range(i, 5):
        if abs(antenas[i] - antenas[j]) > k:
            flag = ':(' # can'5

print(flag)

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 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())
maxA = max(A)
minA = min(A)
lenA = maxA - minA
if lenA <= 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 abs(a - b) <= k and abs(a - c) <= k and abs(a - d) <= k and abs(a - e) <= k and abs(b - c) <= k and abs(b - d) <= k and abs(b - e) <= k and abs(c - d) <= k and abs(c - e) <= k and abs(d - e) <= 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())

points = list()
points.append(a)
points.append(b)
points.append(c)
points.append(d)
points.append(e)

def is_com_all(points):
    for idx_1, idx_2 in itertools.combinations(range(5), 2):
        if points[idx_2] - points[idx_1] > k:
            return False
    
    return True

if is_com_all(points):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

ans = 'Yay!'
for i in range(5):
    for j in range(5):
        if i < j:
            if L[j]-L[i] > k:
                ans = ':('
print(ans)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    A, B, C, D, E, K = int(input()), int(input()), int(input()), int(input()), int(input()), int(input())
    AB, AC, AD, AE = B-A, C-A, D-A, E-A
    BC, BD, BE = C-B, D-B, E-B
    CD, CE = D-C, E-C
    DE = E-D
    if max(AB, AC, AD, AE, BC, BD, BE, CD, CE, DE) <= K:
        print("Yay!")
    else:
        print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	l =[ int(io()) for _ in range(5)]
	k=int(io())
	return ret((l[-1] - l[0]) <= k)

def ret(isOk):
	return 'Yay!' if isOk else ':('

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = True
if e-a>k:
    ans = False

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

Submission status: Accepted

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

k=int(input())

if a[4]-a[0]>k:
    s=0

if s==1:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
li = [int(input()) for i in range(5)]
k = int(input())
for i in range(4):
    if (max(li)-min(li) > k):
        print(":(")
        exit()
print("Yay!")

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    A = []
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))

    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    k = int(input_raw[0])

    if A[len(A) - 1] - A[0] > k:
        print ":("
        return
    print "Yay!"


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

k=int(input())

if L[4]-L[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())

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

Submission status: Accepted

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

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

Submission status: Accepted

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