Problem: 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.

Submission attempts (in order):
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!")

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

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


E-A = e-a

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

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

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

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

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

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

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

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

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




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

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted