Question
The Bridge Balance Point
A city has a long bridge divided into
Find the first such section using 1-based indexing. If no such section exists, print
Input
The first line contains KaTeX can only parse string typed expression. For each test case, the first line contains KaTeX can only parse string typed expression. The second line contains KaTeX can only parse string typed expression integers.
Output
For each test case, print the first balanced index, or KaTeX can only parse string typed expression.
Example
Example 1:
Input
Left of index 3: KaTeX can only parse string typed expression, right: KaTeX can only parse string typed expression.
Example 2:
Input
No index has equal left and right load.
Input
1
5
1 3 5 2 2Output3ExplanationLeft of index 3: KaTeX can only parse string typed expression, right: KaTeX can only parse string typed expression.
Example 2:
Input
1
4
2 1 -1 2Output-1ExplanationNo index has equal left and right load.