~/algor $ cat problems/ochkoz-yoqilgi-quyish
Gas stations
A car drives along a straight road from point $0$ to point $D$. With a full tank it covers $L$ km; it starts the trip with a full tank. There are $n$ gas stations along the road, the $i$-th at point $x_{i}$; at a station the tank is always filled up completely. What is the smallest number of refuelings needed to reach $D$? If $D$ cannot be reached, print $-1$.
Input
The first line contains three positive integers: $D$, $L$ and $n$. The second line contains $n$ positive integers $x_{i}$ in increasing order.
Output
One integer — the smallest number of refuelings or $-1$.
Note
$1 \le n \le 10^{5}$
$1 \le L, D \le 10^{9}$
$0 \lt x_{1} \lt x_{2} \lt \dots \lt x_{n} \lt D$
Examples
950 400 4 200 375 550 750
2
10 3 2 1 2
-1