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())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

i = abs(e-a)

if i < k:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
inp=[a,b,c,d,e]
i=0;
j=0;
kek=true
while i<5:
  j=i
  while j<5:
    if inp[j]-inp[i]>k:
      kek=false
      
if kek:
  print "Yay!"
else:
    print ":("

Submission status: Runtime Error

Solution code:
list = [a,b,c,d,e]
flag = 0

for first_num in list:
    for second_num in list:
        if (first_num - second_num) > abs(k):
          flag = 1
 
if flag == 0:
  print('Yay!')  
else:
  print(':(')

Submission status: Runtime Error

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

if (max(a)-min(a)) > input():
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
a=sorted([int(input()) for _ in range(5)])
ls=sorted([a[i+1]-a[i] for i in range(4)])
print("Yay!" if ls[4]<input() else ":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(4):
	if a[i+1]-a[i]>a[6]:
		print(':(')
		return

print('Yay!')

Submission status: Runtime Error

Solution code:
l = [int(input()) for i in range(5)]
k = int(input())
for i in itertools.combinations(l, 2):
  if i[1] - i[0] > k:
    print(':(')
    exit()
print('Yay!')

Submission status: Runtime Error

Solution code:
import math
import sys

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

for f in antenas:
    for d in antenas:
        if abs(f-d) > k:
            print(":(")
            sys.exit(-1)

print("Yay!")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
inp=[a,b,c,d,e]
i=0;
j=0;
kek=true
while i<5:
  j=i
  while j<5:
    if inp[j]-inp[i]>k:
      kek=false
      
print "Yay!" if kek else print ":("

Submission status: Runtime Error

Solution code:
A = input()
_ = input()
_ = input()
_ = input()
E = input()
k = input()

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

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
inp=[a,b,c,d,e]
i=0;
j=0;
kek=true
while i<5:
  j=i
  while j<5:
    if inp[j]-inp[i]>k:
      kek=false
      
print("Yay!") if kek else print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
list=[int(input()) for i in range(n)]
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 <= 15:
  print('Yey!')
else:
  print(':(')

Submission status: Runtime Error

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

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
inp=[a,b,c,d,e]
i=0;
j=0;
kek=true
while i<5:
  j=i
  while j<5:
    if inp[j]-inp[i]>k:
      kek=false
      
print("Yay!") if kek else print(":(")

Submission status: Runtime Error

Solution code:
temp = input().split()
a, b, c, d, e, k = int(temp[0]), int(temp[1]), int(temp[2]), int(temp[3]), int(temp[4]), int(temp[5])
answer = 0
if e - d > k:
  answer += 1
if d - c > k:
  answer += 1
if c - b > k:
  answer += 1
if b - a > k:
  answer += 1
if answer == 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())
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(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 e-a>=k
  print('Yay!')
else:
  print(':(')

Submission status: Runtime Error

Solution code:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <time.h>
#include <vector>

using namespace std;
typedef long long ll;
template <class T = ll>
T in() {
    T x;
    cin >> x;
    return (x);
}
template <class T>
void print(T &x) {
    cout << x << "\n";
}
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define reps(x, c) for (auto x : c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a)
#define mp(a, b) make_pair((a), (b))
#define pl pair<ll, ll>
#define INF 2147483600
#define MOD 1000000007
#define fi first
#define se second
#define dbg(x) cerr << #x "=" << (x) << "\n"
#define dbgv(x) \
    cerr << #x << "\n"; \
    reps(y, x) { cerr << y << " "; } \
    cerr << "\n"

int main() {
    vector<int> a(5);
    rep(i, 5) { cin >> a[i]; }
    int k = in();

    rep(i, 5) {
        FOR(j, i, 5) {
            if (a[j] - a[i] > k) {
                cout << ":(" << endl;
                return 0;
            }
        }
    }

    cout << "Yay!" << endl;

    return 0;
}

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)

int main (void) {
    int N=5;
    vector<int> A(N);
    REP(i,N) cin>>A[i];
    int K;
    cin>>K;
    bool ans = true;
    if (A[4] - A[0] > K) ans = false;
    if (ans) cout<<"Yay!"<<endl;
    else cout<<":("<<endl;
    return 0;
}

Submission status: Runtime Error

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

d = a[4] - a[0]
k = int(input())

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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