~/algor $ cat problems/ochkoz-aylana-yol
Circular road
There are $n$ gas stations on a circular road, numbered from $1$ to $n$. At the $i$-th station the car gets $g_{i}$ liters of fuel, and the trip to the next station (after the $n$-th — to the $1$-st) uses $c_{i}$ liters. The tank is infinitely large. The car starts with an empty tank at some station, must go all the way around the circle and return to the same station; along the way the fuel in the tank must never become negative. Among such starting stations find the one with the smallest number; if there is none, print $-1$.
Input
The first line contains a positive integer $n$. The second line contains $n$ integers $g_{i}$, the third line contains $n$ integers $c_{i}$.
Output
One integer — the station number or $-1$.
Note
$1 \le n \le 10^{5}$
$0 \le g_{i}, c_{i} \le 10^{9}$
Examples
5 1 2 3 4 5 3 4 5 1 2
4
3 2 3 4 3 4 3
-1