Question
The Bridge Balance Point

A city has a long bridge divided into N sections. Each section has a load value, which may even be negative because some supports pull upward. Engineers want to place a sensor at one section such that the total load to its left equals the total load to its right.

Find the first such section using 1-based indexing. If no such section exists, print -1.

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
1

5
1 3 5 2 2
Output
3
Explanation
Left 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 2
Output
-1
Explanation
No index has equal left and right load.

Online