Problem:


﻿Score: 100 points

Problem Statement

In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.

Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.

Determine if there exists a pair of antennas that cannot communicate directly.

Here, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.  

Constraints

a, b, c, d, e and k are integers between 0 and 123 (inclusive).

a < b < c < d < e

Input

Input is given from Standard Input in the following format:

a
b
c
d
e
k

Output

Print :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.

Sample Input 1

1
2
4
8
9
15

Sample Output 1

Yay!

In this case, there is no pair of antennas that cannot communicate directly, because:

the distance between A and B is 2 - 1 = 1

the distance between A and C is 4 - 1 = 3

the distance between A and D is 8 - 1 = 7

the distance between A and E is 9 - 1 = 8

the distance between B and C is 4 - 2 = 2

the distance between B and D is 8 - 2 = 6

the distance between B and E is 9 - 2 = 7

the distance between C and D is 8 - 4 = 4

the distance between C and E is 9 - 4 = 5

the distance between D and E is 9 - 8 = 1

and none of them is greater than 15. Thus, the correct output is Yay!.

Sample Input 2

15
18
26
35
36
18

Sample Output 2

:(

In this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.
Thus, the correct output is :(.



Sample input:
1
2
4
8
9
15


Sample output:
Yay!

Submission status: Accepted

Solution code:
a = 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:
from itertools import combinations as comb

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

z_comb_list = list(comb(z_list, 2))

flag = True
for comb in z_comb_list:
    if abs(comb[0] - comb[1]) > k:
        print(":(")
        flag = False
        break

if flag:
    print("Yay!")

Submission status: Accepted

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

dis=sorted(ant)
print("Yay!" if dis[-1]-dis[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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
	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(':(')
resolve()

Submission status: Accepted

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

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

ans = 0
for i in range(5):
    for j in range(5):
        if abs(line[i] - line[j]) > k:
            ans += 1
            break

if ans >= 1:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a = [int(input())for i in range(5)]
b = int(input())
for i in range(5):
    for j in range(5):
        if i != j:
            if i < j:
                if a[j] - a[i] > b:
                    print(":(")
                    exit()
            else:
                if a[i] - a[j] >  b:
                    print(":(")
                    exit()
print("Yay!")

Submission status: Accepted

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

import itertools
flag = True
for i in itertools.permutations(range(5), 2):
    if i[0] < i[1]:
        if L[i[1]] - L[i[0]] > k:
            flag = False
if flag:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

if max(lst) - min(lst) > 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:
def A(n,m,k):
    if k >= abs(n - m):
        return True
    else:
        return False

lst = list(map(int,list([input() for i in range(6)])))
k = lst[-1]
r = [A(i,j,k) for j in lst[:5] for i in lst[:5]]
if False not in r:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
#AtCoder 市には、5 つのアンテナが一直線上に並んでいます。
#これらは、西から順にアンテナ A,B,C,D,E と名付けられており、それぞれの座標は a,b,c,d,e です。
#2 つのアンテナ間の距離が k 以下であれば直接通信ができ、k より大きいと直接通信ができません。
#さて、直接 通信ができないアンテナの組が存在するかどうか判定してください。
#ただし、座標 p と座標 q (p<q) のアンテナ間の距離は q−p であるとします。

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


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

Submission status: Accepted

Solution code:
# a~e,kを定義
a, b, c, d, e, k = [int(input()) for _ in range(6)]
# 条件に合わせて出力
if e - a > k:
	print(":(")
else:
	print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

c = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if c[4]-c[0]<=b:
  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())

distance = [b - a, c - a, d - a, e - a, c - b, d - b, e - b, d - c, e - c, e - d]
for i in range(10):
  if k < distance[i]:
    print(":(")
    exit()
print("Yay!")

Submission status: Accepted

Solution code:
import itertools

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

res = itertools.combinations(li,2)


for i,j in res:
    if j - i <= k:
        pass
    else:
        print(":(")
        exit()

print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

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

    input_data.sort()
    input_data.reverse()

    temp = input_data[0] - input_data[4]
    if temp > k :
        print(":(")
    else:
        print('Yay!')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline()[:-1]
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 MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
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

def main():
    a = [0] * 5
    for i in range(5):
        a[i] = INT()
    K = INT()
    if a[-1] - a[0] <= K:
        print('Yay!')
    else:
        print(':(')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#123A
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 = input()
b = input()
c = input()
d = input()
e = input()
k = input()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = int(e)
k = int(k)
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(b-e)>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:
l = [int(input()) for i in range(6)]
if l[4] - l[0] <= l[5]:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums = [int(input()) for _ in range(6)]
if (nums[4]-nums[0])<=nums[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())
a = abs(A-B)
b = abs(A-C)
c = abs(A-D)
d = abs(A-E)
e = abs(B-C)
f = abs(B-D)
g = abs(B-E)
h = abs(C-D)
i = abs(C-E)
j = abs(D-E)
if a<=K and b<=K and c<=K and d<=K and e<=K and f<=K and g<=K and h<=K and i<=K and j<=K:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

LI = [int(input()) for _ in range(6)]
K = LI[-1]

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

Submission status: Accepted

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

s = [int(j) for j in s]

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

Submission status: Accepted

Solution code:
from sys import stdin

x = []
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))

k = int(stdin.readline().rstrip())

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

if flag == 0:
    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()) for i in range(6)]
if max(a[:5])-min(a[:5])<=a[5]:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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

k = int(input())

s_min = min(s)
s_max = max(s)

if s_max - s_min > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
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:
import numpy as np
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())
if e-a > k :
    print(":(")
else :
    print("Yay!")

Submission status: Accepted

Solution code:
def solve(string):
    a, *_, e, k = map(int, string.split())
    return "Yay!" if e - a <= k else ":("


if __name__ == '__main__':
    print(solve('\n'.join([input() for _ in range(6)])))

Submission status: Accepted

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

if (e-a)>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("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]
flag = True
for i in range(5):
	for j in range(5):
		#print(i,j)
		if i == j:
			continue
		else:
			if abs(l[i]-l[j]) > k:
				flag = False
				break

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

Submission status: Accepted

Solution code:
lists = [0,0,0,0,0,0]
for i in range(len(lists)):
        lists[i] = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
inp=[int(input()) for _ in range(5)]
k=int(input())
flg=True
for i in range(len(inp)-1):
    if flg:
        for j in range(i+1,len(inp)):
            if inp[j]-inp[i]>k:
                print(':(')
                flg=False
                break
if flg:
    print('Yay!')

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
antennas = [int(input()) for _ in range(5)]
k = int(input())
print('Yay!' if antennas[4] - antennas[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())

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

else:
    print(":(")

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

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

Submission status: Accepted

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

if B - A > K:
    count += 1
elif C - A > K:
    count += 1
elif D - A > K:
    count += 1
elif E - A > K:
    count += 1
elif C - B > K:
    count += 1
elif D - B > K:
    count += 1
elif E - B > K:
    count += 1
elif D - C > K:
    count += 1
elif E - C > K:
    count += 1
elif E - D > K:
    count += 1

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

Submission status: Accepted

Solution code:
# List = [list(map(int, input().split()))]
# List = [int(input(i)) for i in range(6)]
List = list(int(input()) for i in range(5))
K = int(input())
# print(List)
times = int(0)

for j in range(len(List) - 1):
    for k in range(len(List) - 1):
        if(List[-j] - List[k] > K):
            # print(":(")
            times += 1
            # continue
if(times == 0):
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
import sys

na1 = []

for i1 in range(5):
    na1.append(int(input()))

n1 = int(input())

for i2 in range(5):
    for i3 in range(5):
        if i3 <= i2:
            continue
        elif (na1[i3] - na1[i2]) > n1  :
            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 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:
p = [int(input()) for _ in range(5)]
k = int(input())
ans = "Yay!"
for i in range(5):
    for j in range(i+1,5):
        if p[j] - p[i] > k:
            ans = ":("
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    ant = [a, b, c, d]
    f = False
    for i in ant:
        if e - i > k:
            f = True
            break
    if f:
        print(':(')
    else:
        print('Yay!')

Submission status: Accepted

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

    for i in reversed(range(5)):
        for j in reversed(range(i)):
            if antennas[i] - antennas[j] > k:
                print(':(')
                return

    print('Yay!')


abc()

Submission status: Accepted

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

k = int(input())

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

for j in range(4):
    for i in range(j, 4):
        dist = homes[i + 1] - homes[j]
        if k < dist:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = []
for i in range(5):
    a.append(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("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

# In[2]:


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


# In[6]:


max_d = coord[-1]-coord[0]


# In[7]:


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


# In[ ]:

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("Yay!")

Submission status: Accepted

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

flag = 0
for i in a:
    for j in a:
        if abs(i-j) > k:
            flag = 1
            break            
    else:
        continue
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations

A = [int(input()) for _ in range(5)]
K = int(input())
for x, y in combinations(A, 2):
    if abs(x - y) > K:
        print(':(')
        exit()
print('Yay!')

Submission status: Accepted

Solution code:
#coding:utf-8

import sys

L = list(int(input()) for i in range(6))

for i in range(5):
        for j in range(5):
            if abs(L[i]-L[j]) > L[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())

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

for i in range(5):
    for j in range(5):
        if abs(a_e[i] - a_e[j]) > k:
            print(":(")
            exit()

print("Yay!")

Submission status: Accepted

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

import sys

input = sys.stdin.readline

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

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

    print("Yay!")

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
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:
inp = []
for i in range(5):
    inp.append(int(input()))

k = int(input())
def kyori(p,q):
    if p-q > 0:
        return p-q
    else:
        return q-p

sub = []
for i in range(len(inp)):
  for j in range(len(inp)):
      if i < j:
          sub.append(kyori(inp[i],inp[j]))
      else:
          pass

if max(sub) > 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())
f = True
l = [a, b, c, d, e]
for m in range (0, 5):
    for n in range(m, 5):
        if l[n] - l[m] > k:
            f = False

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

Submission status: Accepted

Solution code:
point = []

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

k = int(input())

for i in range(5) :
    for j in range(5) :
        if abs(point[i] - point[j]) > k :
            print(':(')
            break
    else :
        continue
    break
else :
    print('Yay!')

Submission status: Accepted

Solution code:
a,b,c,d,e,f=map(int,open(0).readlines())
print(":("if e-a>f else"Yay!")

Submission status: Accepted

Solution code:

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

k = int(input())

if l[-1]-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())

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

ans = 'Yay!'
for l in ls:
    for n in ls:
        if l - n > k:
            ans = ':('

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a=[]
for i in range(5):
  a.append(int(input()))
b = int(input())

if max(a) - min(a) > b:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

list=[]
num=6

for i in range(num):
    list.append(int(input()))
    if list[i]<0 or list[i]>123:
        print("Unexpected this input.")
        sys.exit()

for i in range(num-1):
    for j in range(num-1):
        if list[i]-list[j-1]>list[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())

if e - a > k:
    print(':(')

else:
    print('Yay!')

Submission status: Accepted

Solution code:
nums=[]

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

k=int(input())

for i in range(len(nums)):
    for j in range(i+1,len(nums)):
        if abs(nums[i]-nums[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())

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

if((l_max-l_min) > 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=[0,1,2,3,4,5]
for i in range(6):
    a[i]=int(input())
if max(a)-min(a)<=a[5]:
    print("Yay!")
else:
    
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [0 for _ in range(5)]

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

dist = a[4]-a[0]

if dist > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os


dis=0
qmin=123
qmax=0
for i in range(5):
    a=int(input())
    qmin=min(qmin,a)
    qmax=max(qmax,a)

if qmax - qmin<=int(input()):
    print("Yay!")
else:
    print(":(")