100 atcoder#ABC123A. [ABC123A] Five Antennas
[ABC123A] Five Antennas
Score: points
Problem Statement
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna and from west to east, and their coordinates are and , respectively. Two antennas can communicate directly if the distance between them is or less, and they cannot if the distance is greater than . Determine if there exists a pair of antennas that cannot communicate directly. Here, assume that the distance between two antennas at coordinates and () is .
Constraints
- and are integers between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
Print :(
if there exists a pair of antennas that cannot communicate directly, and print Yay!
if there is no such pair.
1
2
4
8
9
15
Yay!
In this case, there is no pair of antennas that cannot communicate directly, because:
- the distance between and is =
- the distance between and is =
- the distance between and is =
- the distance between and is =
- the distance between and is =
- the distance between and is =
- the distance between and is =
- the distance between and is =
- the distance between and is =
- the distance between and is =
and none of them is greater than . Thus, the correct output is Yay!
.
15
18
26
35
36
18
:(
In this case, the distance between antennas and is = and exceeds , so they cannot communicate directly.
Thus, the correct output is :(
.