No.512 Magical Girls' Game of Tag
Problem Statement
The magical girl koba and her master were playing a game of tag. koba runs at $X$ km/h and her master runs at $Y$ km/h.
Since the master is faster ($X < Y$), koba is chasing the master.
Along the road the master runs, there are $N$ intersections located at points $A_i$ m ($1 \le i \le N$) from the starting point (measured along the master's route).
If (and only if) the master has already passed the next intersection ahead at the moment koba arrives at an intersection,
koba loses sight of the master.
Given that koba and the master start at the same time, determine whether koba can keep chasing the master without losing sight of her up to the $N$-th (last) intersection.
Input
$X$ $Y$ $N$ $A_1$ $\cdots$ $A_N$
$1 \le X < Y \le 100$
$1 \le N \le 80$
$0 < A_1 < A_2 < \cdots < A_N \le 100000 = 10^5$
$X$, $Y$, $N$, and each $A_i$ are integers.
Output
Output "YES" if koba can keep chasing the master, or "NO" if she loses sight of the master along the way. (Do not include the quotation marks.)
Print a newline at the end.
Sample
Sample 1
Input
36 72 3 4 7 10
Output
NO
koba runs at 36 km/h = 10 m/s and the master runs at 72 km/h = 20 m/s. After the two start running, when koba reaches the first intersection 0.4 seconds later, the master has already run 8 m and is 1 m past the second intersection. koba has lost sight of the master.
Sample 2
Input
10 20 3 2 4 8
Output
YES
When koba reaches the first intersection, the master just reaches the second intersection. Note that koba does not lose sight of the master in this case.
Sample 3
Input
36 40 5 4 5 6 7 8
Output
YES
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Nasatame