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

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

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

Submission status: Accepted

Solution code:
li = list()
for i in range(5):
  li.append(int(input()))
k = int(input())
ans = False

for i in li:
  for a in li:
    if abs(i-a) > k:
      ans = True
      break;
if ans:
  print(':(')
else:
  print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

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

for i in range(len(list)):
    for j in range(i,len(list)):
        if list[j] - list[i] > k :
            print(':(')
            exit()

print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(map(int,open(0).read().split()))
if s[4] - s[0] > s[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 k<e-a:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:

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

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

min_an = min(an_list)
max_an = max(an_list)

if abs(min_an-max_an) <= 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) 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 (d - e > k):
    print(":(")

else:
    print("Yay!")

Submission status: Accepted

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

d = e - a
k = int(input())

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

Submission status: Accepted

Solution code:

A = [int(input()) for _ in range(5)]
k = int(input())
flag = True
for i in range(5):
    for b in A[i:]:
        if b - A[i] > k:
            flag = False

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

Submission status: Accepted

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

ans = True
for ai in a:
    if a[4] - ai > k:
        ans = False
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
n = [int(input()) for _ in range(6)]
flg = True
for i in range(4):
    for j in range(4 - i):
        if n[j + 1] - n[i] > n[5]:
            flg = False
print([':(', 'Yay!'][flg])

Submission status: Accepted

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

arr = sorted([read_int()[0] for _ in range(5)])
k = read_int()[0]

if __name__ == "__main__":
    if arr[4] - arr[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:
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
    
a.sort()
if a[4]-a[0] > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

for i in range(len(l)):
    for j in range(len(l)-i):
        if abs(l[i] - l[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:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
def solve():
    length = [a,b,c,d,e]
    length.sort()
    if(length[-1]-length[0]>k):
        return print(':(')
    return print('Yay!')
solve()

Submission status: Accepted

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

if max(num) - min(num) >num[5]:
  print(":(")

else:
  print("Yay!")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return int(stdin.readline())

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

Submission status: Accepted

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

    B = A.copy()
    for i in range(5):
        for j in range(i, 5):
            if B[j]-A[i] > k:
                return ':('
    return 'Yay!'

print(m())

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

    antennas = [a, b, c, d, e]
    max_val = max(antennas)
    min_val = min(antennas)

    if max_val - min_val > 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 (
        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
        d - e <= k
):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    a = int(input().rstrip())
    b = int(input().rstrip())
    c = int(input().rstrip())
    d = int(input().rstrip())
    e = int(input().rstrip())
    k = int(input().rstrip())
    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!')
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
import copy
from collections import Counter
from _ast import Or
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 

a=nCast(inputArr(5))
b=int(input())

                   
   

def func():
    global a
    for idx in range(len(a)):
        for idy in range(idx+1,len(a)):
            k=a[idx]-a[idy]
            if(b<abs(k)):
                return ":("
    return "Yay!"
print(func())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
list=[]

for i in range(5):
    x=int(input())
    list.append(x)
k=int(input())
ok_swit=1

for a in range(5):
    for b in range(4-a):
        c=a+b+1
        if abs(list[a]-list[c])>k:
            ok_swit=0

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
#! /usr/bin/python3

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

l = [a, b, c, d, e]
def main():
    for i in range(0, 4):
        for j in range(i+1, 5):
            if l[j] - l[i] > k:
                print(":(")
                return
    print("Yay!")

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

Submission status: Accepted

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

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

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

flag = False

for i in range(5):
    for j in range(i, 5):
        if anntena[j] - anntena[i] > k:
            flag = True
            print(":(")
        if flag:
            break
    if flag:
        break

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

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

if max(nums) - min(nums) <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える

length = []

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

k = int(input())

length.sort()
if length[-1]-length[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 = []
for i in range(5):
    l.append(int(input()))

k = int(input())

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

Submission status: Accepted

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

if max(d) > k:
    ans = ':('
else:
    ans = 'Yay!'

print(ans)

Submission status: Accepted

Solution code:
s = []
for i in range(5):
    s.append(int(input()))
k = int(input())
flag = True
for x in s:
    for y in s:
        if x != y:
            z = x - y
            if z <= k:
                pass
            else:
                flag = False
if flag:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
import sys

l = raw_input().split()
a = int(l[0])
l = raw_input().split()
b = int(l[0])
l = raw_input().split()
c = int(l[0])
l = raw_input().split()
d = int(l[0])
l = raw_input().split()
e = int(l[0])
l = raw_input().split()
k = int(l[0])
if b - a > k:
    print(':(')
    exit()
if c - a > k:
    print(':(')
    exit()
if d - a > k:
    print(':(')
    exit()
if e - a > k:
    print(':(')
    exit()
if c - b > k:
    print(':(')
    exit()
if d - b > k:
    print(':(')
    exit()
if e - b > k:
    print(':(')
    exit()
if d - c > k:
    print(':(')
    exit()
if e - c > k:
    print(':(')
    exit()
if d - e > k:
    print(':(')
    exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = int(input())
_ = int(input())
_ = int(input())
_ = int(input())
e = int(input())
k = int(input())

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

print(r)

Submission status: Accepted

Solution code:
*antena, k = [int(input()) for _ in range(6)]

# for i in range(5):
#     for j in range(5):

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

ok = True
for i in [a, b, c, d, e]:
    for j in [a, b, c, d, e]:
        if abs(j - i) > k:
            ok = False

if 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())
delta=int(input())
l=[b-a,c-a,d-a,e-a,c-b,d-b,e-b,d-c,e-c,e-d]
if max(l)<=delta:
  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 or b-a>k or e-b>k or c-a>k or c-e>k or d-a>k or d-e>k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
x = [int(input()) for i in range(5)]
k = int(input())
for i in range(1, 5):
    for xi in x[:i]:
        if x[i] - xi > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list = []

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

for idx, x in enumerate(antenas):
    for y in antenas[idx:]:
        if abs(x - y) > 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())
import sys
ary = [a,b,c,d,e]
for i in ary:
    for j in ary:
        if abs(i-j) > 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())
dis_list = []
dis_list.append(abs(a-b))
dis_list.append(abs(a-c))
dis_list.append(abs(a-d))
dis_list.append(abs(a-e))
dis_list.append(abs(b-c))
dis_list.append(abs(b-d))
dis_list.append(abs(b-e))
dis_list.append(abs(c-d))
dis_list.append(abs(c-e))
dis_list.append(abs(d-e))
if max(dis_list) > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

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

flg = True
if np.abs(a-b) > k:
    flg = False
if np.abs(a-c) > k:
    flg = False
if np.abs(a-d) > k:
    flg = False
if np.abs(a-e) > k:
    flg = False
if np.abs(b-c) > k:
    flg = False
if np.abs(b-d) > k:
    flg = False
if np.abs(b-e) > k:
    flg = False
if np.abs(c-d) > k:
    flg = False
if np.abs(c-e) > k:
    flg = False
if np.abs(d-e) > k:
    flg = False
    
if flg:
    print('Yay!')
else:
    print(":(")

Submission status: Accepted

Solution code:
a = [0 for i in range(6)]
for i in range(6):
    a[i] = int(input())
k = a[-1]
max_diff = a[-2] - a[0]
if max_diff > k:
    print(':(')
else:
    print("Yay!")

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  a = readInts()[0]
  b = readInts()[0]
  c = readInts()[0]
  d = readInts()[0]
  e = readInts()[0]
  k = readInts()[0]

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

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
N = []
for i in range(6):
    n = int(input())
    N.append(n)
K = N.pop()
for i in range(5):
    for j in range(i, 5):
        if N[j] - N[i] > K:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a = INT()
b = INT()
c = INT()
d = INT()
e = INT()
k = INT()

for i in [b,c,d,e]:
	if (i-a) > k:
		print(":(")
		break
else:
	for i in [c, d, e]:
		if (i-b) > k:
			print(":(")
			break
	else:
		for i in [d, e]:
			if (i-c) > k:
				print(":(")
				break
		else:
			if (e-d) > k:
				print(":(")
			else:
				print("Yay!")

Submission status: Accepted

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

flag = False
if ins[4] - ins[0] > k:
    flag = True

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

Submission status: Accepted

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

k = int(input())


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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):
    a=int(input())
    A.append(a)
k=int(input())
for i in range(5):
  for j in range(5):
    if abs(A[i]-A[j])>k:
        print(":(")
        quit()
print("Yay!")

Submission status: Accepted

Solution code:
from sys import stdin

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

isOK = True

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

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

Submission status: Accepted

Solution code:
d1 = int(input())
d2 = int(input())
d3 = int(input())
d4 = int(input())
d5 = int(input())
sa = int(input())
data = sorted([d1, d2, d3, d4, d5])
if data[-1] - data[0] > sa:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A = [I() for i in range(5)]
k = I()
ans = A[-1]-A[0]
if ans <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
array = []
for i in range(6):
    array.append(int(input()))
for i in range(5):
    for j in range(1, 5):
        if abs(array[i] - array[j]) > array[-1] and i != j:
            print(":(")
            exit()
else:
    print("Yay!")

Submission status: Accepted

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

flg = True
for x, y in [(a, b), (a, c), (a, d), (a, e), (b, c), (b, d), (b, e), (c, d), (c, e), (d, e)]:
    if y -x <= k:
        continue
    else:
        flg = False
        break
if flg:
    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 or d-a >k or c-a>k or b-a>k or e-b > k or d-b > k or c-b>k or e-c >k or d-c >k or e-d>k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
a=[int(input()) for _ in range(5)]
k=int(input())
for x in a[1:]:
    if x-a[0]>k:
        print(':(')
        ans=False
        break
    else:
        ans=True
if ans==True:
    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 = 0
if abs(a-b) > k:
  f = 1
if abs(a-c) > k:
  f = 1
if abs(a-d) > k:
  f = 1
if abs(a-e) > k:
  f = 1
if abs(b-c) > k:
  f = 1
if abs(b-d) > k:
  f = 1
if abs(b-e) > k:
  f = 1
if abs(c-d) > k:
  f = 1
if abs(c-e) > k:
  f = 1
if abs(d-e) > k:
  f = 1


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

res = []
res.append(abs(a - b))
res.append(abs(a - c))
res.append(abs(a - d))
res.append(abs(a - e))
res.append(abs(b - c))
res.append(abs(b - d))
res.append(abs(b - e))
res.append(abs(c - d))
res.append(abs(c - e))
res.append(abs(d - e))

res = sorted(res)
if res[-1] > 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())
antena=[a,b,c,d,e]
for i in antena:
  for j in antena:
    if abs(i-j)>k:
      print(':(')
      exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

k = int(input())

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

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

Submission status: Accepted

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

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

ae = e-a

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = [int(input()) for _ in range(5)]
k = int(input())

y = True
for i in a [1:]:
    if i - a[0] > k:
        y = False
        break

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

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

Submission status: Accepted

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

t = [int(input()) for i in range(6)]
for i in range(5):
    for j in range(5):
        if t[j]-t[i] > t[5]:
            print(":(")
            sys.exit()
print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

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()) for _ in range(5)]
print([":(", "Yay!"][a[-1] - a[0] <= int(input())])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[0]*5
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
k=int(input())
c=0
for i in range(5):
  for j in range(i+1,5):
    if(abs(a[j]-a[i])>k):
      c+=1
if(c!=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 = "Yay!"

if abs(a-b)>k:
    answer = ":("

if abs(a-c)>k:
    answer = ":("

if abs(a-d)>k:
    answer = ":("

if abs(a-e)>k:
    answer = ":("

if abs(b-c)>k:
    answer = ":("

if abs(d-b)>k:
    answer = ":("

if abs(e-b)>k:
    answer = ":("

if abs(c-d)>k:
    answer = ":("

if abs(c-e)>k:
    answer = ":("

if abs(d-e)>k:
    answer = ":("

print(answer)

Submission status: Accepted

Solution code:
from itertools import*
a,b,c,d,e,k=map(int,open(0).read().split())
x=[a,b,c,d,e]
for i in combinations(x,2):
    p,q=list(i)
    if abs(p-q)>k:
        print(":(")
        exit()
print("Yay!")

Submission status: Accepted

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

kyori = abcde[4]-abcde[0]

if kyori<=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())
lst = [a,b,c,d,e]
for i in lst:
    for j in lst:
        if i - j > k:
            print(":(")
            exit()
            
print("Yay!")