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: Wrong Answer

Solution code:
list = []
list.append(input())
list.append(input())
list.append(input())
list.append(input())
list.append(input())

k = input()

ju = "Yay!"

for i in range(5):
    for j in range(5):
        if i == j:
            pass
        else:
            dis = abs(int(list[i]) - int(list[j]))

            if dis <= int(k):
                ju = ":("

print(ju)

Submission status: Wrong Answer

Solution code:
ant = []

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

for i in range(0,5):
    for j in range(i+1,5):
      if ant[j] - ant[i] > k:
            print(':(')
            exit()
print('Yey!')

Submission status: Wrong Answer

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

list = []
list.append(int(input()))
list.append(int(input()))
list.append(int(input()))
list.append(int(input()))
list.append(int(input()))
k = int(input())

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

Submission status: Wrong Answer

Solution code:
A = [0]*5
for i in range(5):
    A[i] = int(input())
k = int(input())
flag = 0
for j in range(4):
    for k in range(4-j):
        if abs(A[j]-A[3-k]) > k:
            flag = 1
            break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def __main__():
    P = []
    for i in range(5):
        P.append(int(input()))
    k = int(input())
    
    for i in range(4):
        for j in range(4-i):
            if P[i] - P[j] > k:
                print(":(")
                return
    
    print("Yay!")
    return

if __name__ == "__main__":
    __main__()

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
a = []

for i in range(6):
    a.append(int(input()))

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

Submission status: Wrong Answer

Solution code:
num = []

for _ in range(5) :
    num.append(int(input()))

k = int(input())

ans = True

for i in range(4) :
    for l in range(i + 1, 4) :
        if num[l] - num[i] > k :
            ans = False

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

Submission status: Wrong Answer

Solution code:
antena=[]
for i in range(0, 5):
    antena.append(int(input()))
k = int(input())
flag = 0
for i in range(0, 4):
    for j in range(i+1, 5):
        if antena[j]-antena[i]>k:
            flag = 1
if flag==0:
    print("Yey!")
else:
    print(":(")

Submission status: Wrong Answer

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

c = 0
for i, a in enumerate(A[:-1]):
	for j, b in enumerate(A[i+1:-1]):
		c += 1 if K < b - a else 0
print([":(", "Yay!"][not(0<c)])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = 5
list=[int(input()) for i in range(n)]
p = int(input())
max = 0
a = 0
for i in range(n):
  for j in range(n):
    a = abs(list[i] - list[j])
    if a > max:
      max = a
      
if max <= p:
  print('Yey!')
else:
  print(':(')

Submission status: Wrong Answer

Solution code:
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # greatest common divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # least common multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
# n = II()
# dp = [INF] * n
# h = LI()
# dp[0], dp[1] = 0, abs(h[1] - h[0])
# for i in range(2, n):
    # dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i])
    # dp[i] = min(dp[i-2] + abs(h[i]-h[i-2]), dp[i])
# P(dp[n-1])
a = II()
b = II()
c = II()
d = II()
e = II()
k = II()
list = sorted([a,b,c,d,e])
for i in range(len(list)):
    for j in range((len(list))-i):
        if list[i] -list[j] > k:
            print(':(')
            exit()
print('Yey!')

Submission status: Wrong Answer

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: Wrong Answer

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

ans = "Yay!"

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

print(ans)

Submission status: Wrong Answer

Solution code:
temp = []

a = int(input())
temp.append(a)
b = int(input())
temp.append(b)
c = int(input())
temp.append(c)
d = int(input())
temp.append(d)
e = int(input())
temp.append(e)
k = int(input())
ans = 'Yay!'
for i in range(len(temp)):
    if i==len(temp)-1:
        break
    for j in range(len(temp)):
        if j==len(temp)-1:
            break       
        if i==j:
            continue
        if abs(temp[i]-temp[j])>k:
            ans = ':('
            break
print(ans)

Submission status: Wrong Answer

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

p_list = [1, b, c, d, e]
neg_pair = False

for i in range(5):
  for j in range(5):
    dist = abs(p_list[i] - p_list[j])
    if dist > k:
      neg_pair = True
      break
if neg_pair:
  print(":(")
else:
  print("Yay!")

Submission status: Wrong Answer

Solution code:

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

flag = False
for i in range(5):
    for j in range(4 - i):
        if list[j] - list[i] > list[5]:
            flag = True

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

Submission status: Wrong Answer

Solution code:
A = [0]*5
for i in range(5):
    A[i] = int(input())
k = int(input())
flag = 0
for j in range(4):
    for k in range(4-j):

        if abs(A[j]-A[3-k]) > k:

            print(":(")
            flag = 1
            break

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

Submission status: Wrong Answer

Solution code:
#[a,b,c,d,e,k] = map(int,list(input().split()))
l = []
for i in range(6):
    l.append(int(input()))

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

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
g=0
if b-a>k: #k以下の時通信可能
  g=1
elif c-b>k:
  g=1
elif d-c>k:
  g=1
elif e-d>k:
  g=1

if g==0: #通信できる
  print("Yay!")
elif g==1:
  print(":(")

Submission status: Wrong Answer

Solution code:
a = []
for i in range(6):
    a.append(input())
maxn = 0
minn = 128
for i in range(4):
	if(maxn < a[i]):
		maxn = a[i]
	if(minn > a[i]):
		minn = a[i]
if(maxn - minn > a[5]):
	print(":(")
else:
	print("Yay!")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
anntena_list = []

for i in range(5):
    anntena_list.append(int(input()))
    
m = int(input())
    
for i in range(4):
    if anntena_list[i+1] - anntena_list[i]  > m:
        print(':C')
        break
    if i == 3:
        print('Yay!')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
max = 0
min = 999999999
for i in range(5):
    t = int(input())
    if max < t:
        max = t
    if min > t:
        min = t

k = int(input())

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

Submission status: Wrong Answer

Solution code:
input_lines = input().split()
a = int(input_lines[0])
input_lines = input().split()
b = int(input_lines[0])
input_lines = input().split()
c = int(input_lines[0])
input_lines = input().split()
d = int(input_lines[0])
input_lines = input().split()
e = int(input_lines[0])
input_lines = input().split()
k = int(input_lines[0])
if e - a <= k:
    print("Yay!")
else:
    print(":()")

Submission status: Wrong Answer

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

mx = 0
mn = 0xFFFFFFFF
for i in range(5):
    a = int(input())
    mx = max(mx, a)
    mn = min(mn, a)
    print(a)
k = int(input())
if k < abs(mx - mn):
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
input_ha = []
for i in range(0,5):
    input_ha.append(int(input()))
max_in = max(input_ha)
min_in = min(input_ha)

k = int(input())

if(max_in - min_in):
    print("Yay!")
else:
    print(':(')

Submission status: Wrong Answer

Solution code:
antenas = [int(input()) for i in range(5)]
distance = int(input())
res = "Yay!"

for i in range(len(antenas)):
  for j in range(i + 1, len(antenas)):
    if antenas[j] - antenas[i] > 15:
      res = ":("
      break

print(res)

Submission status: Wrong Answer

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

result = 'Yay!'
for i, a1 in enumerate(range(len(a) - 1)):
    for j, a2 in enumerate(range(len(a) - 1)):
        if i != j and i - j > a[-1]:
            result = ':('
print(result)

Submission status: Wrong Answer

Solution code:
import sys


def main():
    h = [int(input()) for count in range(6)]
    k = h[5]
    for i in range(len(h) - 2):
        if abs(h[i] - h[i + 1]) > k:
            print(":(")
            sys.exit()
    print("Yay!")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys

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

def main():

    points = []

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


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

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

    print('Yay!')
    return 0

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = []
list.append(input())
list.append(input())
list.append(input())
list.append(input())
list.append(input())

k = input()

ju = "Yay!"

for i in range(5):
    for j in range(5):
        if i == j:
            pass
        else:
            dis = int(list[i]) - int(list[j])

            if dis <= int(k):
                ju =":("

print(ju)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
l =input().split()
k = l[len(l)-1]
for i in range(0,len(l)-1):
    for j in range(i+1,len(l)-1):
        if math.fabs(l[i]-l[j]) > k:
            print(":(")
            break
print("Yay!")

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

li = []
for i in range(5):
    li.append(int(input()))
k = int(input())
if max(li) <= k:
    print('Yay!')
else:
    print(":(")

Submission status: Wrong Answer

Solution code:
max = 0
min = 999999999
for i in range(5):
    t = int(input())
    if max < t:
        max = t
    if min > t:
        min = t

k = int(input())

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

ans = ':('
if max(input_list) - min(input_list) < int(input()):
    ans = 'Yay!'

print(ans)

Submission status: Wrong Answer

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

k = int(input())
f = True

for i in range(0, 5):
    for j in range(i + 1, 5):
        if a[j] - a[i] > k:
            f = False
            print(":(")
            break
if f:
    print("Yay!")

Submission status: Wrong Answer

Solution code:
ans='Yay'
data=[]
for i in range(5):
    data.append(int(input()))

K=int(input())
for i in range(5):
    for j in  range(i,5):
        if abs(data[i]-data[j])>K:
            ans=':('
            break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str = input()
print(str)

Submission status: Wrong Answer

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

k = int(input())
flag = -1
pos = [a, b, c, d, e]
for i in pos:
    for j in pos:
        if abs(i-j) > k:
            flag = 1
        else:
            flag = 0

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

mx = 0
mn = 0xFFFFFFFF
for i in range(5):
    a = int(input())
    mx = max(mx, a)
    mn = min(mn, a)
k = int(input())
if k <= abs(mx - mn):
    print(":(")
else:
    print("Yay!")

Submission status: Wrong Answer

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)-1):
    for j in range(i,len(list)-1):
        if list[j] - list[i] > k :
            print(':(')
            exit()

print('Yay!')

Submission status: Wrong Answer

Solution code:
ant = []

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

for i in range(0,5):
    for j in range(i+1,5):
        if abs(ant[i] - ant[j]) > k:
            print(':(')
            exit()
print('Yey!')

Submission status: Wrong Answer

Solution code:


def start_process(length, num):

    print(ans)

def main():
    a = [ int(input()) for i in range(5)]
    # b = int(input())
    # c = int(input())
    # d = int(input())
    # e = int(input())
    k = int(input())
    flg = 0
    for i in range(5):
        for j in range(i + 1, 5):
            if a[j] - a[i] >= k:
                flg = 1
                break

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

def kari():
    a = list(map(int, input().split()))
    a, b = map(int, input().split())

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = [int(input()) for  _ in range(5)]
k = int(input())
for i in range(4):
  if (A[i + 1] - A[i] > k ):
    print(':(')
    exit()

print('Yay!')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

array = [a,b,c,d,e]
flag = True
for i in range(4):
    for j in range(i, 5):
        if array[i] - array[j] < k:
            pass
        else:
            flag = False
            
if flag:
    print('Yes')
else:
    print(':(')

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
tmp=[a-b,a-c,a-d,a-e,b-c,b-d,b-e,c-d,c-e,d-e]
tmp=list(map(abs,tmp))
a=False
for i in tmp:
    if i<k:
        a=True
if a:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

Solution code:
import sys

a = int(sys.stdin.readline())
b = int(sys.stdin.readline())
c = int(sys.stdin.readline())
d = int(sys.stdin.readline())
e = int(sys.stdin.readline())
k = int(sys.stdin.readline())
ret = ':)' if k < (e - a) else "Yay!"
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

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

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
"""
python3 main.py < input.txt
"""
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a < k:
    print('Yey!')
else:
    print(':(')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

k = int(input())
c =0
for i in range(4):
    if abs(a[i+1] - a[i]) > k:
        c += 1
    
if c != 0:
    print(':(')
else:
    print('Yay!')

Submission status: Wrong Answer

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: Wrong Answer

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

s = [abs(a-b), abs(a-c), abs(a-d), abs(a-e), abs(b-c), abs(b-d), abs(b-e), abs(c-d), abs(c-e), abs(d-e)]
ans = "Yay!"
for ss in s:
  if ss >= k:
    ans = ":("
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
for i in range(4):
    for j in range(4-i):
        if abs(a[i]-a[j]) <= k:
            ans += 1
if ans == 10:
    print("Yay!")
else:
    print(":(")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print("Yay!")

Submission status: Wrong Answer

Solution code:
ant = []

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

for i in range(0,5):
    for j in range(1,5):
        if abs(ant[i] - ant[j]) > k:
            print(':(')
            exit()
print('Yey!')

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
xs = []
for x in range(5):
   xs.append(int(input()))
k = int(input())
if max(xs) - min(xs) > k:
    print(":(")
else:
    print("Yay")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from itertools import product
from collections import defaultdict
def inpl(): return list(map(int, input().split()))

X = [0]*6
for i in range(6):
    X[i] = int(input())
a, b, c, d, e, k = X

for l, r in product(X[:5], repeat=2):
    if abs(l-r) >= k:
        print(":(")
        break
else:
    print("Yay!")

Submission status: Wrong Answer

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()
if c-b>k:
  print(':(')
  exit()
if d-c>k:
  print(':(')
  exit()
if e-d>k:
  print(':(')
  exit()
print('Yay!')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

result = 'Yay!'
for i, a1 in enumerate(range(len(a) - 1)):
    for j, a2 in enumerate(range(len(a) - 1)):
        if i != j and i - j < a[-1]:
            result = ':('
print(result)