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:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in sys.stdin.readline().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v

def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


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

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


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 = [int(input()) for _ in range(6)]
if l[4]-l[0]>l[5] :
    print(":(");
else:
    print("Yay!");

Submission status: Accepted

Solution code:
num = list()
for ii in range(5):
    num.append(int(input()))
dist = int(input())

if num[-1] - num[0] <= dist:
    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=[]
for i in range(5):
    b=int(input())
    a.append(b)
c=int(input())
if a[4] - a[0] <= c:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

a = inputList[0]
d = inputList[4]
k = inputList[5]

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

Submission status: Accepted

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

Submission status: Accepted

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

ds = []
for idx, antenna in enumerate(antennas):
    for j in range(idx+1, 5):
        ds.append(antennas[j] - antenna)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INPUT_NUM = 5
numbers = tuple(int(input()) for _ in range(INPUT_NUM))
dist_k = int(input())

can_direct_connect = True
for i in range(INPUT_NUM - 1):
    for j in range(INPUT_NUM - 1 - i):
        dist = numbers[j + i + 1] - numbers[i]
        if dist > dist_k:
            can_direct_connect = False
            break
    if not can_direct_connect:
        print(':(')
        break
else:
    print('Yay!')

Submission status: Accepted

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

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


def calc(m, n):
    return True if n - m > k else False


set_list = [(a, b), (a, c), (a, d), (a, e), (b, c),
            (b, d), (b, e), (c, d), (c, e), (d, e)]

ans = 'Yay!'
for i in range(len(set_list)):
    m, n = set_list[i]
    if calc(m, n):
        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())
print('Yay!') if e-a <= k else print(':(')

Submission status: Accepted

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

input_size = len(input_val)
count = 0
for i in range(5) :
    stan_val = input_val[i]
    for j in range(i+1,5) :
        diff = abs(stan_val - input_val[j])
        if diff > input_val[5] :
            count += 1
            
        else : count = count

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

Submission status: Accepted

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

k = int(input())
for i in range(1, 5):
    for j in range(i):
        if (antenna[i] - antenna[j]) > k:
            far_antenna += 1
            break
        else:
            continue
if far_antenna != 0:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
# abc123_a.py
antena_pos=[int(input()) for _ in range(5)]
k=int(input())
max_dist=antena_pos[-1]-antena_pos[0]

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


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

l=[a,b,c,d,e]
size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit()

print("Yay!")
"""

Submission status: Accepted

Solution code:
# abc123_a.py
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

l=[]
# l=[a,b,c,d,e]
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)

size=len(l)
for i in range(size):
 for j in range(i,size):
  if i == j:
   continue
  if (l[j]-l[i]) > k:
   print(":(")
   exit()

print("Yay!")

Submission status: Accepted

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


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

    exist = points[4] - points[0] > k

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_dist = antena_pos[-1] - antena_pos[0]

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

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

flg = False
for i in range(0, 5):
    for j in range(0, 5):
        if abs(coor[i] - coor[j]) > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
antenna_coordinates = [int(input()) for i in range(5)]
distance_limit = int(input())
result = 'Yay!'

for i in range(1, 5):
    if abs(antenna_coordinates[0] - antenna_coordinates[i]) > distance_limit:
        result = ':('
        break

print(result)

Submission status: Accepted

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

def func():
    for i in range(4):
        for j in range(i,5):
            if abcde[j]-abcde[i] > k:
                return ":("
    return "Yay!"
  
print(func())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

L = [int(input()) for _ in range(6)]
k = L.pop(-1)
ans = "Yay!"
if max(L)-min(L) > k:
    ans = ":("
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###############################################################################

from bisect import bisect_left as binl

def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * sy) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


###############################################################################


def main():
    poslist = intinl(5)
    k = intin()

    for i in poslist:
        for j in poslist:
            if abs(j - i) > k:
                print(':(')
                return 0

    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())
AC = [a, b, c, d, e]
for i in range(4):
  for j in range(i+1, 5):
    if AC[j]-AC[i] > k:
      print(":(")
      break
  else:
    continue
  break
if e-a <=k:
  print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = sorted(list(map(int, [input() for i in range(5)])))
k = int(input())
if (a[4] - a[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)])
if e - a <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

if list[4]-list[0] > list[5]:
  print(":(")
  
else:
  print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def ti():
    return int(input())

a = [None] * 5
for _ in range(5):
    a[_] = ti()

k = ti()

def solve():
    for x in a:
        d = x-a[0]
        if d > k:
            return ':('
    return 'Yay!'

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = True
for i in range(5):
  if not flag:
    break
  for j in range(i+1, 5):
    if a[j] - a[i] > k:
      flag = False
      break

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

Submission status: Accepted

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

a = sorted(a)
if abs(a[0]-a[-1]) > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

t = [0] * 6
for i in range(6):
    t[i] = int(input())

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

Submission status: Accepted

Solution code:
a_to_e = [int(input()) for i in range(5)]
k = int(input())
if max(a_to_e) - min(a_to_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())
if len(list(filter(lambda x: x>k,[b-a,c-a,d-a,e-a,c-b,d-b,e-b,d-c,e-c,e-d]))) > 0:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#coding:utf-8

def main():
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    flag = True

    if b-a > k:
        flag = False
    elif c-a > k:
        flag = False
    elif d-a > k:
        flag = False
    elif e-a > k:
        flag = False
    elif c-b > k:
        flag = False
    elif d-b > k:
        flag = False
    elif e-b > k:
        flag = False
    elif d-c > k:
        flag = False
    elif e-c > k:
        flag = False
    elif d-e > k:
        flag = False

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


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:
  ans = 'Yay!'
else:
  ans = ':('
print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
dis = e - a
if dis <= 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:
A = [0]*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 (e-a)>k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
import itertools
cnt=0
z=[]
for n in range(5):
    z.append(int(input()))
k = int(input())
c= list(itertools.combinations(z,2))
for i in c:
    temp = list(i)
    if temp[1]-temp[0]<=k:
        cnt+=1
if cnt==10:
    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())

A=[a,b,c,d,e]
count=0
for i in range(5):
    for j in range(5):
        if abs(A[i]-A[j])>k:
            count+=1
if count==0:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:

# 整数の入力
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

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

max = max(l)
min = min(l)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if k < t:
    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!')
elif b-a > k or c-b > k or d-c > k or e-d > k:
  print(':(')
elif c-a > k or d-b > k or e-c > k:
  print(':(')
elif d-a > k or e-b > k:
  print(':(')
elif e-a > k:
  print(':(')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#a,b,c,d,e,k = 2,4,7,8,15,1
#box = [a,b,c,d,e]
import itertools
box = []
for i in range(0,5):
    box.append(int(input()))
k = int(input())
c = 0
for two in list(itertools.combinations(box,2)):
    if (two[1]- two[0] > k):
        c +=1
    else:
        pass
if c == 0:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

p1=abs(a-b)
p2=abs(a-c)
p3=abs(a-d)
p4=abs(a-e)
p5=abs(b-c)
p6=abs(b-d)
p7=abs(b-e) 
p8=abs(c-d)
p9=abs(c-e)
p10=abs(d-e)

if((p1>k) or (p2>k) or (p3>k) or (p4>k) or (p5>k) or (p6>k) or (p7>k) or (p8>k) or (p9>k) or (p10>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 = [input() for _ in range(5)]
k = input()
if a[4] - a[0] > k:
  print ':('
else:
  print 'Yay!'

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A=[]
key=0
for i in sys.stdin.readlines():
    A.append(int(i.rstrip()))
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())
f=int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 123
# https://atcoder.jp/contests/abc123
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def check(nn, k):
    nnl = len(nn)
    for i in range(nnl):
        for j in range(i+1, nnl):
            d = abs(nn[i] - nn[j])
            if d > k:
                return False
    return True

def main():
    abcde = ii2nn(5)
    k = i2n()
    if check(abcde, k):
        print('Yay!')
    else:
        print(':(')

main()

Submission status: Accepted

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

for i in range(5):
    for j in range(1+i, 5):
        #        print("i={} j={}".format(i, j))
        if (a[j]-a[i]) > a[5]:
            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:
from itertools import combinations

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

k = int(input())
frag = True

for combi in combinations(anntena, 2):
    if abs(combi[0] - combi[1]) > k:
        frag = False    
        break
    
if(frag):
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()

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

Submission status: Accepted

Solution code:
list = []
for i in range(5):
  list.append(int(input()))
k = int(input())
 
r = "Yay!"
for a in list:
  for b in list:
    if abs(a-b) > k:
      r = ":("
      break
 
print(r)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ind = 0
for i in A:
    for j in A:
        if(abs(i - j) >k):
            ind = 1

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

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

r = "Yay!"
for a in list:
  for b in list:
    if abs(a-b) > k:
      r = ":("
      break

print(r)

Submission status: Accepted

Solution code:
list1 = [input() for i in range(5)]
num = int(input())
list1 = list(map(int,list1))
list2 = []

for i in range(5):
    for k in range(i+1,5):
        list2.append(list1[k]-list1[i])

if max(list2) <= num:
    print ("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
A=[]
for i in range(0,6):
  A.append(int(input()))
end=1
for i in range(0,5):
  for j in range(i,5):
    if A[j]-A[i]>A[5]:
      end=0
      break
if end==0:
    print(":(")
else:
	print("Yay!")

Submission status: Accepted

Solution code:
lis = []

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

NUM = int(input())

count = 0
correct = 0
for i in range(5):
    for k in range(i + 1, 5):
        if lis[k] - lis[i] <= NUM and lis[i] - lis[k] <= NUM:
            correct += 1
        count += 1

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

Submission status: Accepted

Solution code:
crd = []
a = int(input())
crd.append(a)
b = int(input())
crd.append(b)
c = int(input())
crd.append(c)
d = int(input())
crd.append(d)
e = int(input())
crd.append(e)
k = int(input())

#print(len(crd))
for x in range(len(crd)):
    for y in range(x+1, len(crd)-x):
        #print(x, y)
        #print(crd[int(x)], crd[int(y)])
        z = k - (crd[y] - crd[x])
        #print("z= ", z)
        if z < 0:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")

Submission status: Accepted

Solution code:
a,b,c,d,e,k=map(int,open(0).read().split())
print('Yay!' if max(a,b,c,d,e)-min(a,b,c,d,e)<=k else ':(')

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(5)]
k = int(input())
if max(l)-min(l) > 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]

Flag = "Yay!"
for i in range(5):
    for j in range(5):
        if abs(list[i] - list[j]) > k:
            Flag = ":("
            break
print(Flag)

Submission status: Accepted

Solution code:
a=[]
for _ in range (6):
	a.append(int(input()))
k=a[5]
del a[5]
if max(a)-min(a)>k:
	print(":(")
else:
	print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
in_num = []
conn_frg = 0
for i in range(5):
    in_num.append(int(input()))
line_num = int(input())

for j in range(4):
    k = j+1
    while k < 5:
        if abs(in_num[j] - in_num[k]) > line_num:
            conn_frg = 1
        k += 1

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

Submission status: Accepted

Solution code:
a = []
sum = 0
for i in range(6):
    a.append(int(input()))
dist = a[4] - a[0]
if dist > 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:
# coding: utf-8

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
coordinate=[]
for i in range(5):
  coordinate.append(int(input()))
k=int(input())
status=True
for i in range(5):
  for j in range(i):
    if (coordinate[i]-coordinate[j])>k:
      status=False
      
if status:
  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())

r = e - a

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import itertools
l = []
for _ in range(5):
    l.append(int(input()))
k = int(input())
flag = 0
for ele in itertools.combinations(l, 2):
    if ele[1] - ele[0] > k:
        flag = 1
if flag == 0:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

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