Question
Delivery Truck Fuel Circle
A delivery truck must travel around a circular route with
Return the index of a station from where the truck can complete the full circle, or
Input
The first line contains an integer KaTeX can only parse string typed expression.
The second line contains KaTeX can only parse string typed expression integers — KaTeX can only parse string typed expression.
The third line contains KaTeX can only parse string typed expression integers — KaTeX can only parse string typed expression.
Output
Print a single integer — a valid starting index, or KaTeX can only parse string typed expression.
Example
Example 1:
Input
Example 2:
Input
Input
5
1 2 3 4 5
3 4 5 1 2Output3Example 2:
Input
3
2 3 4
3 4 3Output-1