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: Runtime Error

Solution code:
a.b.c.d.e.k=map(int,input().split())
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 abs(c-d)>=k and abs(c-e)>=k and abs(d-e)>=k:
  print("Yey!")
else:
  print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print("Yay!")

Submission status: Runtime Error

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

for i in range(4):
    for j in range(5):
        if lis[i] != lis[j]
        print(":(")
        exit()

print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,k = 0
for i in range(6):
  t = int(input())
  if(i == 0):
    a = t
  elif(i == 4):
    b = t
  elif(i == 5):
    k = t

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

Submission status: Runtime Error

Solution code:
a,b,k = 0
for i in range(6):
  t = int(input())
  if(i == 0):
    a = t
  elif(i == 4):
    b = t
  elif(i == 6):
    k = t

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

Submission status: Runtime Error

Solution code:
a, _,e,k=map(int,open(0).read().split())
print(e-a<=k ‘Yay!’or ‘:(‘)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a=[int(input())for _ in range(5)]
k=int(input())
if e-a<=k:print("Yay!")
else:print(":(")

Submission status: Runtime Error

Solution code:
import sys
from bisect import bisect_left,bisect_right,insort
input = sys.stdin.readline

def main():
    x,y,z,K=map(int,input().split())
    a=sorted(list(map(int,input().split())))
    b=sorted(list(map(int,input().split())))
    c=sorted(list(map(int,input().split())))
    l,r=a[0]+b[0]+c[0],a[-1]+b[-1]+c[-1]
    while l+1<r:
        ans=0
        m=(l+r)//2
        for i in range(x-1,-1,-1):
            if a[i]>=m:
                ans+=y*z
                continue
            for j in range(y-1,-1,-1):
                if a[i]+b[j]>=m:
                    ans+=z
                    continue
                for k in range(z-1,-1,-1):
                    if a[i]+b[j]+c[k]>=m:
                        ans+=1
                        continue
                    else:
                        break
        if ans>=K:
            l=m
        else:
            r=m
    s=[0]
    for i in range(x-1,-1,-1):
        for j in range(y-1,-1,-1):
            for k in range(z-1,-1,-1):
                if a[i]+b[j]+c[k]>=l:
                    s.append(a[i]+b[j]+c[k])
                    continue
                else:
                    break
    s.sort()
    for i in range(len(s)-1,0,-1):
        print(s[i])

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
an=[int(x) for x in input().split()]
k=an[-1]
max=max(an[:-2])
min=min(an[:-2])
if max -min < k:
    print("Yay!")
else:
    print(":()")

Submission status: Runtime Error

Solution code:
import math
n = int(input())
li=[int(input()) for i in range(n)]
print(math.ceil(n/min(li))+4)

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
l1
for _ in range(6):
  l1.append(int(input()))

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c, d, e, k = int(input()) for i in range(6)
print("Yey!" if (e-a)<=k else ":(")

Submission status: Runtime Error

Solution code:
a, b, c, d, e, k = int(input()) for i range(6)
print("Yey!" if (e-a)<=k else ":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

flg = True
for i in range(len(antena)):
  for j in range(len(antena)):
    if a[i] - a[j] > k:
      flg = False
      break
    
if flg:
  print('Yay!')
else:
  print(':(')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = ([map(int, input())for _ in range[5]])
k = int(input())
ans="Yay!"
for i in range(1,4):
	if k < a[i]-a[0]:
		ans=":("
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(4):
  for _ in range(1,5):
    if x[i] - x[_] > k:
      print(":(")
    exit()
else:
  print("Yey!")

Submission status: Runtime Error

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

for i in range(4):
  for _ in range(1,5):
    if x[i] - x[_] < k:
      print("Yey!")
    else:
      print(":(")

Submission status: Runtime Error

Solution code:
a=[int(input()) for i in range(5)]
k=int(input())
for i in range(n-1):
  for j in range(1,n):
    if abs(a[i]-a[j])>k:
      print(':(')
      exit()
print('Yay')

Submission status: Runtime Error

Solution code:
a=[int(input()) for i in range(5)]
k=int(input())
for i in range(n-4):
  for j in range(1,n):
    if abs(a[i]-a[j])>k:
      print(':(')
      exit()
print('Yay')

Submission status: Runtime Error

Solution code:
X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

AB = [0] * (K * K)
for itra, a in enumerate(A):
  if itra >= K:
    break
  for itrb, b in enumerate(B):
    AB[itra * K + itrb] = (a + b)
    if itrb >= K - 1:
      break
    
AB.sort(reverse=True)    
    
ABC = [0] * (K * K)
for itrab, ab in enumerate(AB):
  if itrab >= K:
    break
  for itrc, c in enumerate(C):
    ABC[itrab * K + itrc] = (ab + c)
    if itrc >= K - 1:
      break
    
ABC.sort(reverse=True)
for itr, i in enumerate(ABC):
  print(i)
  if itr >= K - 1:
    break

Submission status: Runtime Error

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

x = list[a,b,c,d,e]
y = sorted(x)

if k >= y[4] -y[0]:
    print('Yay!')

else:
    print(':(')

Submission status: Runtime Error

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

x = list(a,b,c,d,e)
y = sorted(x)

if k >= y[4] -y[0]:
    print('Yay!')

else:
    print(':(')

Submission status: Runtime Error

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

c=0
for j in range(4):
    lgth=abs(lst[j]-lst[j+1])
    if lgth>k:
        print(':(')
    elif k==3 and lgth<=k:
        print('Yay!')

Submission status: Runtime Error

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

c=0
for j in range(4):
    lgth=abs(lst[j]-lst[j+1])
    if lgth>k:
        print(':(')
    elif k==3 and lgth<=k:
        print('Yay!')

Submission status: Runtime Error

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

c=0
for j in range(4):
    lgth=abs(lst[j]-lst[j+1])
    if lgth>k:
        print(':(')
    elif k=3 and lgth<=k:
        print('Yay!')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print("Yay!")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if abs(a-b) > k 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 orabs(d-e) > k :
  print(':(')
else:
  print('Yay!')

Submission status: Runtime Error

Solution code:
usrInput = []
for n in range(6):
  usrInput.append(int(input()))
 
for l in range(5):
  for m in range(5):
    if abs(int(usrInput[l])-int(usrInput[m])) > usrInput[5]:
      flag = True
 
if flag:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
usrInput = {}
for n in range(6):
  append.usrInput = input()

for l in range(5):
  for m in range(5):
    if abs(int(usrInput[l])-int(usrInput[m])) > usrInput[6]:
      flag = True

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
dis=list[a,b,c,d,e,k]

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

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())




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

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())


E-A = e-a

if E-A > k:
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if (A-B > k) or (A-C > k) or (A-D > k) or (A-E > k) or (B-C > k) or (B-E > k) or (C-D > k) or (C-E > k) or (D-E > k):
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if A-B > k or A-C > k or A-D > k or A-E > k or B-C > k or B-E > k or C-D > k or C-E > k or D-E > k:
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if (A-B or A-C or A-D or A-E or B-C or B-E or C-D or C-E or D-E) > k :
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if A-B or A-C or A-D or A-E or B-C or B-E or C-D or C-E or D-E > k :
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if A-B and A-C and A-D and A-E and B-C and B-E and C-D and C-E and D-E > k :
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if A-B and A-C and A-D and A-E and B-C and B-E and C-D and C-E and D-E > k :
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = abs(b-a)
A-C = abs(c-a)
A-D = abs(d-a)
A-E = abs(e-a)
B-C = abs(c-b)
B-D = abs(d-b)
B-E = abs(e-b)
C-D = abs(d-c)
C-E = abs(e-c)
D-E = abs(e-d)

if A-B and A-C and A-D and A-E and B-C and B-E and C-D and C-E and D-E > k:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k= map(int, input().split())

A-B = abs(a-b)
A-C = abs(a-c)
A-D = abs(a-e)
A-E = abs(a-e)
B-C = abs(b-c)
B-D = abs(b-d)
B-E = abs(b-e)
C-D = abs(b-d)
C-E = abs(c-e)
D-E = abs(d-e)

if A-B and A-C and A-D and A-E and B-C and B-E and C-D and C-E and D-E > k:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
#--import & define---------------------
import math

def yes():
    print("Yes")
def no():
    print("No")
#--memo--------------------------------
#mapを利用した入力
# x,y = map(int,input().split())

#forを利用した入力
#l = []
#for i in range():
#    l.append(int(input()))
#    print(i,l)
#--------------------------------------
l = []
for i in range(6):
   l.append(int(input()))

if l[0]-l[1]>l[5] or l[1]-l[2]>l[5] or l[2]-l[3]>l[5] or l[3]-l[4]>l[5] or:
    no()
else:
    yes()

Submission status: Runtime Error

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

if l[0]-l[1]>l[5] or l[1]-l[2]>l[5] or l[2]-l[3]>l[5] or l[3]-l[4]>l[5] or:
    no()
else:
    yes()

Submission status: Runtime Error

Solution code:
import math

def yes():
    print("Yes")
def no():
    print("No")

a,b,c,d,e,k = map(int,input().split())

if a-b > k or b-c > k or c-d > k or d-e > k:
    no()
else:
    yes()

Submission status: Runtime Error

Solution code:
import math

def yes():
    print("Yes")
def no():
    print("No")

a,b,c,d,e,k = map(int,input().split())
if a-b > k or b-c > k or c-d > k or d-e > k:
    no()
else:
    yes()

Submission status: Runtime Error

Solution code:
l=list(int(input()) for _ in range(5))
m=int(input())
cnt=0
for i in range(5):
  if l[i+1]-l[i]<=m:
    cnt+=1
print([":(","Yay!"][cnt==5])

Submission status: Runtime Error

Solution code:
a, e, k=map(int, input().split())
if e-a>k:
  print(':(')
else:
  print('Yay!')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l=[int(input()) for i in range(5)]
a,c=min(l),max(l)
k=int(input())
print("Yay!") if (a-b)**2<=k**2 else print(":(")

Submission status: Runtime Error

Solution code:
lists=[]
for i n range(5):
  nums=int(input())
  lists.append(nums)
dis=int(input())
lists=sorted(lists)
if lists[-1]-lists[0]<=dis:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k=map(int,input().split())
if max(a-b,a-c,a-d,a-e) <= k:
    A='Yey!'
else:
    A=':('

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin

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

from itertools import combinations
lin = list(combinations(li, 2))

for i in li:
    if abs(lin[i][0]-lin[i][1]) > k:
        print(":(")
        exit()

print("Yay!")

Submission status: Runtime Error

Solution code:
s = input()
tmp = s.split("¥n")
k = tmp[len(tmp)-1]
ans = "Yay!"
for i in range(len(tmp))-2:
    if tmp[i+1] - tmp[i] > k:
        ans = ":("

print(ans)

Submission status: Runtime Error

Solution code:
for _ in range(6):
    a.append(int(input()))
for i in range(6):
    for j in a[i+1:]:
        if abs(a[i]-j) > k:
            print(":(")
            exit()
print("Yay!")

Submission status: Runtime Error

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]
if max(lis) - min(lis) <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from itertools import product

x, y, z, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

s = sum

delecious = []
for prod in product(a, b, c):
    delecious.append(s(prod))

delecious.sort(reverse=True)

for i in range(k):
    print(delecious[i])

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
distance = []
for i in range(4):
    for j in range(i + 1, 4):
        distance.append(anntena[j] - anntena[i])
    
tmp = [i for i in distance if i  > k ]
if len(tmp) == 0:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c, d, e, k= map(int, input().split())
if e - a > k:
    print(':(')
else:
    print('Yey!')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A = map(int,input())

print("Yay!" if A <= A[5] else ":(" )

Submission status: Runtime Error

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

out = 0
for i in range(5):
    for j in range(i+1,5):
        if ABCDE[j] - ABCDE[i] > K:
            out += 1
            break

print(['Yay!',':('][out])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
input_a = ()
input_b = ()
input_c = ()
input_d = ()
input_e = ()
input_k = ()
if (input_a - input_e) < input_k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**9)

x,y,z,k=map(int, input().split())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
c=list(map(int, input().split()))

ans1=[]
ans2=[]

for i in range(x):
    for j in range(y):
        ans1.append(a[i]+b[j])
ans1.sort()
ans1.reverse()

if len(ans1)>=k:
    del ans1[k:]
    
for i in range(len(ans1)):
    for j in range(z):
        ans2.append(ans1[i]+c[j])
ans2.sort()
ans2.reverse()

for i in range(k):
    print(ans2[i])

Submission status: Runtime Error

Solution code:
from sys import exit


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

num_list = [a, b, c, d, e]
len_num_list = len(num_list)

for i in range(len_num_list):
    for j in range(len_num_list):
        if i == j:
            pass
        else:
            tnum = abs(num_list[i] - num_list[j])
            if tnum > k:
                print(':(')
                exit()

if res == 0:
    print('Yay!')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

I[0] = a
I[4] = e
I[5] = k

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

Submission status: Runtime Error

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

I[0] = a
I[4] = e
I[5] = k

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

Submission status: Runtime Error

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

I[0] = a
I[4] = e
I[5] = k

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

Submission status: Runtime Error

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

I[0] = a
I[4] = e
I[5] = k

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

Submission status: Runtime Error

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

I[0] = a
I[5] = e
I[6] = k

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

Submission status: Runtime Error

Solution code:
I = int(input()) for i in range(6):

I[0] = a
I[5] = e
I[6] = k

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
li=list(map(int,input().split("\n")))
k=li[5]
if li[1]-li[0]>5 or li[2]-li[1]>5 or li[3]-li[2]>5 or li[4]-li[3]>5:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a_list = []

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

N = int(input())

ctr = 0

flag = 0

while ctr <= 5:
  if a_list[ctr+1] - a_list[ctr] >= N:
    flag += 1
  ctr += 1

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

Submission status: Runtime Error

Solution code:
lst=[]
for i in 5:
	lst.append(int(input()))
k = int(input())
sor = sorted(lst)
if sor[4] - sor[0] > k:
	print(":(")
else:
	print("Yay!")

Submission status: Runtime Error

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

d = True
for i in range(5):
  if d:
  for j in range(i,5):
    if antenna[j]-antenna[i] > K:
      print(':(')
      d = False
      break
if d:
  print('Yay!')

Submission status: Runtime Error

Solution code:
x, y, z, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ans_list = []
for i in a:
    for j in b:
        ans_list.append(i+j)
ans_list.sort(reverse=True)
ans_list = ans_list[:min(3001, x*y*z+1)]
ans_list_2 = []
for i in ans_list:
    for j in c:
        ans_list_2.append(i+j)
ans_list_2.sort(reverse=True)
for i in range(k):
    print(ans_list_2[i])

Submission status: Runtime Error

Solution code:
a, b, c, d, e = map(int, input().split())

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

Submission status: Runtime Error

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

for i in range(4):
  if L[i+1]-L[i]>k:
    print(':(')
    break
  
  if i==3:
    print(Yay!)

Submission status: Runtime Error

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

for i in range(4):
  if L[i+1]-L[i]>k:
    print(':(')
    break
  
  if i=3:
    print(Yay!)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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