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:
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()))
D = []
E2 = []
F = []

# A + Bの全列挙 からのソート 

for i in A : 
    for j in B : 
        D.append(i+j)
        
E = sorted(D, reverse = True)

if len(E) > K : 
    for i in range(K) : 
        E2.append(E[i])
else : 
    E2 = E
        
####

for i in E2 : 
    for j in C : 
        F.append(i+j)
        
G = sorted(F, reverse = True)

for i in range(K) : 
    print(G[i])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
xs = [for i in range[5]]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("YES")
else:
	print("NO")

Submission status: Runtime Error

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

flag = "Yay!"
for i in range(len(li)-1):
    if li[i+1] - li[i] > li[5]:
        flag = ":("

return flag

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=[int(i) for i in input().split()]

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

Submission status: Runtime Error

Solution code:
S=[int(i) for i in input().split()]

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

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k=int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
k = inputs.pop(5)
if inputs[-1] - inputs[0] > k:
  print('Yay!')
else:
  print(':(')

Submission status: Runtime Error

Solution code:
inputs = []
while 1:
  tmp = input()
  if tmp:
    inputs.append(tmp)
  else:
    break
k = inputs.pop(5)
if inputs[-1] - inputs[0] > k:
  print('Yay!')
else:
  print(':(')

Submission status: Runtime Error

Solution code:
N = 6
val = []
for i in range(N):
    val.append(int(input())
if val[4]-val[0] <= val[5]:
    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('Yay!')
else:
    print(':(')

Submission status: Runtime Error

Solution code:
a = []
for i in (5):
  a += [int(input())]
k = int(input())
a.sort()
kekka = ":("
if a[4] - a[0] <= k:
  kekka = "Yay!"
print(kekka)

Submission status: Runtime Error

Solution code:
a = []
for i in (5):
  a += [int(input())]
a.sort()
kekka = ":("
if a[4] - a[0] <= k:
  kekka = "Yay!"
print(kekka)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
# coding = utf-8
list1 = []

for n in range(6):

    list1.append(int(input()))

count = 0
for city1 in list1[:4]:
    for city2 in list1[:4]:
        if city1 - city2 > list[5] | city2 - city1 > list[5]:
            print ':('
            count += 1
            break
if count = 0:
    print 'Yay!'

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H,W=map(int,intput().split())
h,w=map(int,input().split())
print(W*H-h*W-H*w+h*w)

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

ls = [0]*(len(A)*len(B))
for i in range(len(A)):
    for j in range(len(B)):
        ls[(i*len(B))+j] = A[i] + B[j]
ls.sort(reverse = True)
ls = ls[:k]
check_ls = []
for i in range(len(C)):
    for j in range(len(ls)):
        check_ls.append(C[i] + ls[j])
check_ls.sort(reverse = True)
for i in range(k):
    print(check_ls[i])

Submission status: Runtime Error

Solution code:
a=[]
for i invrangr(6):
  a.append(int(input()))
if a[4]-a[0]>a[5]:
  print(":(")
else:
  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()))
l = []

for i in a:
    for j in b:
        l.append(a + b)
l.sort(reverse = True)
l = l[:K]

L = []

for i in l:
    for j in c:
        L.append(i + j)

L.sort(reverse = True)
print(*L[:K], sep = "\n")

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

for i in range(X):
    for j in range(Y):
        l.append(a[i] + b[j])
l.sort(reverse = True)
l = l[:K]

L = []
c.sort(reverse = True)

for i in range(len(l)):
    for j in range(min(Z, K)):
        L.append(l[i] + c[j])

L.sort(reverse = True)
print(*L[:K], sep = "\n")

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

for i in range(X):
    for j in range(Y):
        l.append(a[i] + b[j])
l.sort(reverse = True)
l = l[:K]

L = []
c.sort(reverse = True)

for i in range(len(l)):
    for j in range(min(Z, K)):
        L.append(l[i] + c[j])

L.sort(reverse = True)
for i in range(K):
    print(L[i])

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;
int main() {
	int A, B, C, D, E, K;
	cin >> A >> B >> C >> D >> E >> K;
	cout << (E - A <= K ? "Yay!" : ":(") << endl;
	return 0;
}

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;
int main() {
	int A, B, C, D, E, K;
	cin >> A >> B >> C >> D >> E >> K;
	cout << (E - A <= K ? "Yay!" : ":(") << endl;
	return 0;
}

Submission status: Runtime Error

Solution code:
 alpha=[int(intput()) for_in range(5)]
    k=int(intput())
    for a in alpha:
        for b in alpha:
            if abs(a-b)>k:
                print (':(')
                exit()
    print('Yay!')

Submission status: Runtime Error

Solution code:
def main():
    alpha=[int(intput()) for _in range(5)]
    k=int(intput())
    for a in alpha:
        for b in alpha:
            if abs(a-b)>k:
                print (':(')
                exit()
    print('Yay!')

Submission status: Runtime Error

Solution code:
def main():
    alpha=[int(intput()) for_in range(5)]
    k=int(intput())
    for a in alpha:
        for b in alpha:
            if abs(a-b)>k:
                print (':(')
                exit()
    print('Yay!')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
X,Y,Z,K = map(int, input().split())
a_list = [int(i) for i in input().split()]
b_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]
a_list.sort(reverse = True)
b_list.sort(reverse = True)
c_list.sort(reverse = True)
total_list = [0 for _ in range(min(106307,X*Y*Z))]
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if (i+1)*(j+1)*(k+1) <= K:
                total_list[i*(Z*Y)+j*Z+k] = (a_list[i] + b_list[j] + c_list[k])
            else:
                break
total_list =  sorted(total_list, reverse = True)
for i in range(K):
    print(total_list[i])

Submission status: Runtime Error

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

println(e - a <= k ? "Yay!" : ":(")

Submission status: Runtime Error

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

lenge = 0

for i in range(A):
  for j in range(A):
    if A[i] - A[j] > K:
      lenge += 1
      
if lenge == 0:
  print(":(")
else :
  print("Yay!")

Submission status: Runtime Error

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

lenge = 0

for i in range(A):
  for j in range(A):
    if A[i] - A[j] > K:
      s += 1
      
if s == 0:
  print(":(")
else :
  print("Yay!")

Submission status: Runtime Error

Solution code:
n, h, w = [int(i) for i in input().split()]
print(sum(h <= a and w <= b for a, b in ([int(i) for i in input().split()] for _ in range(n))))

Submission status: Runtime Error

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

def check(a,e,k):
  a=in[0]
  e=in[4]
  k=in[5]
  if e-a>k :
    return :(
  else:
    return Yay!

Submission status: Runtime Error

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

if in[4]-in[0]>in[5]:
  return :(
    
else:
    return Yay!

Submission status: Runtime Error

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

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

A = sorted(map(int,input().split()))[::-1]
B = sorted(map(int,input().split()))[::-1]
C = sorted(map(int,input().split()))[::-1]

AB = [a+b for a in A for b in B]
AB.sort(reverse = True)

ans = [ab + c for ab in AB[:k] for c in C]
ans.sort(reverse = True)

for i in ans[:k]:
    print(i)

Submission status: Runtime Error

Solution code:
antennas = []
for _ in range(5):
  a = int(input())
  antennas.append(a)
k = int(input())
cannot_communicate_pair_exists = False
for i in range(len(antennas)):
  for q in range(len(antennas)):
    if i == q:
      continue
    if abs(antennas(i)-antennas(q)) > k:
      cannot_communicate_pair_exists = True
      break
  if cannot_communicate_pair_exists:
    break
if cannot_communicate_pair_exists:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
from itertools import product

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

AB = [a + b for a, b in product(A, B)]
AB.sort(reverse=True)

ABC = [ab + c for ab, c in product(AB[:K], C)]
ABC.sort(reverse=True)

for abc in ABC[:K]:
    print(abc)

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

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

Submission status: Runtime Error

Solution code:
# https://img.atcoder.jp/abc123/editorial.pdf
# 問題D: Cake 123 解法 #3 - さらに高速な解法、priority-queue を用いて O(K log K)

from heapq import heappush, nlargest

def solve(X, Y, Z, K, A, B, C):
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)

    Q = []
    for a in A:
        for b in B:
            heappush(Q, a+ b)
    AB = nlargest(K, Q)

    Q2 = []
    for ab in AB:
        for c in C:
            heappush(Q2, ab + c)
    ABC = nlargest(K, Q2)
    print("\n".join(map(str, ABC)))

if __name__ == "__main__":
    X, Y, Z, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    solve(X, Y, Z, K, A, B, C)

Submission status: Runtime Error

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

difs = [b-a, c-b, d-c, e-d]
Mdif = Max(difs)
if Mdif <= k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

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

difs = [b-a, c-b, d-c, e-d]
Mdif = Max(difs)
if Mdif <= k:
  print("Yay!)
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a = int(input())
_ = int(input())
_ = int(input())
_ = 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())
d = int(input())
f = int(input())
h = int(input())
e = int(input())
k = int(input())

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

Submission status: Runtime Error

Solution code:
from itertools import product

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

ab = [ai + bi for (ai, bi) in product(a, b)]
ab.sort(reverse=True)
abc = [abi + ci for (abi, ci) in product(ab[: min(k, x * y * z)], c)]
abc.sort(reverse=True)

for abci in abc[: min(k, x * y * z)]:
    print(abci)

Submission status: Runtime Error

Solution code:
`a=[0]*5
for i in range(5):
    a[i]=int(input().strip())
k=int(input().strip())
d=max(a)-min(a)
if d<=k:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
list = []
indent = 0
for i in range(5):
  memory = 9
  list.append(int(input()))
  if memory > list[i] % 10 && list[i] % 10 != 0:
  	indent = i
 
count = 0
for i in range(5):
  if i == indent:
    count += list[i]
  else:
    count += 10 * (int(list[i]/10) + 1)
 
print(count)

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)

ABC = []
for i in range(X):
    for j in range(Y):
        if i + 1 + j + 1 > K:
            break
        for k in range(Z):
            if i + 1 + j + 1 + k + 1 > K:
                break
            ABC.append(A[i] + B[j] + C[k])

ABC.sort(reverse=True)
for i in range(K):
    print(ABC[i])

Submission status: Runtime Error

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

for i in range(4):
  for j in range(3-i):
    if list[i+1+j] - list[i] > k:
      print(":(")
      break
  else:
    print("Yay!")
  break

Submission status: Runtime Error

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

k = int(input())
if a[5] - a[0] > k:
    print(":(")
else:
    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)
t = []
for i in set(range(x)):
    for j in set(range(y)):
        for l in set(range(z)):
            if (i+1) * (j+1) * (l+1) <= k:
                t.append(a[i]+b[j]+c[l])
            else:
                break
t.sort(reverse=True)
for i in range(k):
    print(t[i])

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)
ans=[]
for i in range(x):
  for j in range(y):
    for k in range(z):
      if (i+1)*(j+1)*(k+1)<=K:
        ans.append(a[i]+b[j]+c[k])
      else:
        break
ans.sort(reverse=True)
for i in range(K):
  print(ans[i])

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

int main() {
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    if (e - a > k) cout << ":(" << endl;
    else cout << "Yay!" << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
test

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:
a, b, c, d, e, k = (int(x) for x in input().split()

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

Submission status: Runtime Error

Solution code:
A=[int(input()) for i in range(6)]
def Five(A):
	for i in range(len(A)-2):
  		if A[i+1]-A[i] > A[-1]:
    		return print(":(")
	return print("Yay!")
Five(A)

Submission status: Runtime Error

Solution code:
A=[int(i) for i in input()]
def Five(A):
	for i in range(len(A)-2):
  		if A[i+1]-A[i] > A[-1]:
    		return print(":(")
	return print("Yay!")
Five(A)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

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

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Submission status: Runtime Error

Solution code:
import heapq as hq

X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

pri = []
data = []
hq.heapify(pri)

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

hq.heappush(pri, [-A[0]-B[0]-C[0],0,0,0])
data.append([0,0,0])

for i in range(K):
    s = pri[0][1]
    t = pri[0][2]
    u = pri[0][3]
    if s+1 <= X-1:
        if [s + 1, t, u] not in data:
            data.append([s+1, t, u])
            hq.heappush(pri, [-A[s+1]-B[t]-C[u],s+1,t,u])
    if t+1 <= Y-1:
        if [s, t+1, u] not in data:
            data.append([s, t+1, u])
            hq.heappush(pri, [-A[s]-B[t+1]-C[u],s,t+1,u])
    if u+1 <= Z-1:
        if [s, t, u+1] not in data:
            data.append([s, t, u+1])
            hq.heappush(pri, [-A[s]-B[t]-C[u+1],s,t,u+1])
    print(hq.heappop(pri)[0] * -1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print((int(input())+1)//sorted([input() for _ in range(5)])+5)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if max(a[-1]) - min(a[-1]) > a[-1]:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
a = list(map(int,[input() for i in range(4)]))

if max(a[-1]) - min(a[-1]) > a[-1]:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
a = list(map(int,i for i in input()))

if max(a[-1]) - min(a[-1]) > a[-1]:
  print(":(")
else:
  print("Yay!")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

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

data = []

for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if i * j * k <= K:
                data.append(A[i] + B[j] + C[k])
                
data.sort()
data.reverse()
for i in range(K):
    print(data[i])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(6)]
# array1 = [15,18,26,35,36,18]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 =! 0]
array4 = [i % 10 for i in array3]
sum1 = 0
sum2 = sum(array2)
if (len(array3) != 0):
  idx = array4.index(min(array4))
  for k, i in enumerate(array3):
    if (k == idx):
      sum1 += i
    else:
      sum1 += i + (10 - i % 10)
  print(sum1 + sum2)

Submission status: Runtime Error

Solution code:
import sys
input = lambda: sys.stdin.readline().strip

l = [int(input()) for _ in range(5)]
k = int(input())
print('Yay!' if k >= l[4] - l[0] else ':(')

Submission status: Runtime Error

Solution code:
a = [int(i) for i in input().split()]

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

Submission status: Runtime Error

Solution code:
N = 6 #the number of the input data
a = [[int(i) for i in input().split()] for j in range(N)]

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

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(6)]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
    if (i < 4 and array2[4 - i] - array2[0] > k):
        print(':(')
        break
    if (i < 3 and array2[4 - i] - array2[1] > k):
        print(':(')
        break
    if (i < 2 and array2[4 - i] - array2[2] > k):
        print(':(')
        break
    if (i < 1 and array2[4 - i] - array2[3] > k):
        print(':(')
        break
    if (i == 4):
        print('Yay!')

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(6)]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
    if (i < 4 and array2[4 - i] - array2[0] > k):
    	print(':(')
        break
    if (i < 3 and array2[4 - i] - array2[1] > k):
    	print(':(')
        break
    if (i < 2 and array2[4 - i] - array2[2] > k):
    	print(':(')
        break
    if (i < 1 and array2[4 - i] - array2[3] > k):
    	print(':(')
        break
    if (i == 4):
        print('Yay!')

Submission status: Runtime Error

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

for i in range(5):
    if (i < 4):
        if (array2[4 - i] - array2[0] > k):
            print(':(')
            break
    if (i < 3):
        if (array2[4 - i] - array2[1] > k):
            print(':(')
            break
    if (i < 2):
        if (array2[4 - i] - array2[2] > k):
            print(':(')
            break
    if (i < 1):
        if (array2[4 - i] - array2[3] > k):
            print(':(')
            break
    if (i == 4):
        print('Yay!')

Submission status: Runtime Error

Solution code:
input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
    if (i < 4):
        if (array[size - i - 1] - array[0] > k):
            print(':(')
            break
    if (i < 3):
        if (array[size - i - 1] - array[1] > k):
            print(':(')
            break
    if (i < 2):
        if (array[size - i - 1] - array[2] > k):
            print(':(')
            break
    if (i < 1):
        if (array[size - i - 1] - array[3] > k):
            print(':(')
            break
    if (i == 4):
        print('Yay!')

Submission status: Runtime Error

Solution code:
import itertools
x,y,z,t = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
b.sort()
c.sort()
ans = []
for i in range(x):
    for k in range(y):
        ans.append(a[i]+b[k])
ans.sort()
ans.reverse()
if x*y > t:
    ans = ans[0:t]
out = []
for i in range(len(ans)):
    for k in range(z):
        out.append(ans[i]+c[k])
out.sort()
out.reverse()
for i in range(t):
    print(out[i])

Submission status: Runtime Error

Solution code:
import itertools


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

AB = [a + b for (a, b) in list(itertools.product(A, B))]
AB = sorted(AB)[::-1]
ans = [ab + c for (ab, c) in list(itertools.product(AB[:3000], C))]
ans = sorted(ans)[::-1]
for i in range(K):
    print(ans[i])

Submission status: Runtime Error

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

A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

val_list = []


A_list = sorted(A_list, reverse=True)
B_list = sorted(B_list, reverse=True)
C_list = sorted(C_list, reverse=True)

for a in range(len(A_list)):
    if a + 1 > K:
        break
    for b in range(len(B_list)):
        if b + 1 > K:
            break
        if (a+1) * (b+1) > K:
            break
            
        for c in range(len(C_list)):
            if c + 1 > K:
                break
            if (a+1) * (b+1) * (c+1) > K:
                break
        
            val_list.append(A_list[a] + B_list[b] + C_list[c])

val_list = sorted(val_list, reverse=True)
for i in range(K):
    print(val_list[i])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys

args = [int(input()) for i in range(6)]

 if (args[4] - arg[0]) > args[5]:
    print(":(")
print("Yay!")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

args = [int(input()) for i in range(6)]

if (args[4] - arg[0]) > args[5]:
    print(":(")
    sys.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 b-a<k:
  if c-a<k:
    if d-a<k:
      if e-a<k:
        print("Yay!")
      else:
        print(":(")
        break
    else:
      print(":(")
      break
  else:
    print(":(")
    break
else:
  print(":(")
  break

Submission status: Runtime Error

Solution code:
import sys

args = [int(input()) for i in range(6)]

 if (args[0] - arg[4]) > args[5]:
        print(":(")
        sys.exit()
print("Yay!")

Submission status: Runtime Error

Solution code:
import sys

args = [int(input()) for i in range(6)]

 if (args[0] - arg[4]) > args[5]:
            print(":(")
            sys.exit()
print("Yay!")

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<string>
#include<map>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
    int a, b, c, d, e;
    int k;
    scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e);
    scanf("%d", &k);

    string ans;
    int L = e - a ;
    if (L > k) ans  = "Yay!";
    else ans = ":("

    printf("%d\n", ans)
}

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()))
ab=sorted(s+t for t in B for s in A)[-1:-K-1:-1]
abc=sorted(i+x for i in ab for x in C)[-1:-K-1:-1]
print(*abc,sep="\n")X, Y, Z, K = map(int, input().split())

Submission status: Runtime Error

Solution code:
import sys

args = [input() for i in range(6)]

for arg1 in args[:5]:
    for arg2 in args[1:5]
        if (arg2 - arg1) > args[5]:
            print(":(")
            sys.exit()
print("Yay!")

Submission status: Runtime Error

Solution code:
import sys

args = [input() for i in range(6)]

for arg1 in args[:5]:
    for arg2 in args[1:5]:
        if (arg2 - arg1) > args[5]:
            print(":(")
            sys.exit()
print("Yay!")