#ABC123A. Five Antennas

Five Antennas

题目描述

In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A,B,C,DA, B, C, D and EE from west to east, and their coordinates are a,b,c,da, b, c, d and ee, respectively.
Two antennas can communicate directly if the distance between them is kk or less, and they cannot if the distance is greater than kk.
Determine if there exists a pair of antennas that cannot communicate directly.
Here, assume that the distance between two antennas at coordinates pp and qq (p<qp \lt q) is q−pq - p.

在 AtCoder 城中,有五根天线矗立在一条直线上。自西向东依次为 A,B,C,DA, B, C, D 和 EE ,坐标分别为 a,b,c,da, b, c, d 和 ee 。
如果两根天线之间的距离小于或等于 kk ,则可以直接通信;如果距离大于 kk ,则不能直接通信。
请判断是否存在一对不能直接**通信的天线。
这里假设坐标 pp 和 qq ( p<qp \lt q )处的两根天线之间的距离为 q−pq - p 。

输入格式

输入内容按以下格式标准输入:

aa
bb
cc
dd
ee
kk

输出格式

如果存在一对无法直接通信的天线,则打印 :(;如果不存在这样一对天线,则打印 Yay!。

样例 #1

样例输入 #1

1
2
4
8
9
15

样例输出 #1

Yay!

样例 #2

样例输入 #2

15
18
26
35
36
18

样例输出 #2

:(

说明

数据规模与约定

  • a,b,c,d,ea, b, c, d, e 和 kk 是介于 00 和 123123 (含)之间的整数。
  • a<b<c<d<ea \lt b \lt c \lt d \lt e

样例 11 解释

在这种情况下,没有一对天线不能直接通信,因为

  • AA 和 BB 之间的距离是 2−12 - 1 = 11
  • AA 和 CC 之间的距离是 4−14 - 1 = 33
  • AA 与 DD 之间的距离是 8−18 - 1 = 77
  • AA 与 EE 之间的距离是 9−19 - 1 = 88
  • BB 与 CC 之间的距离是 4−24 - 2 = 22
  • BB 和 DD 之间的距离是 8−28 - 2 = 66
  • BB 与 EE 之间的距离是 9−29 - 2 = 77
  • CC 与 DD 之间的距离是 8−48 - 4 = 44
  • CC 与 EE 之间的距离是 9−49 - 4 = 55
  • DD 和 EE 之间的距离是 9−89 - 8 = 11

它们都不大于 1515 。因此,正确的输出是 "Yay!"。

样例 22 解释

在本例中,天线 AA 和 DD 之间的距离为 35−1535 - 15 = 2020 ,超过了 1818 ,因此无法直接通信。因此,正确的输出是 :(.