Under construction

Still being built. Things may change

Expression

Time limit2sMemory limit1024 MB

Summary
Given n cards with integers, find the smallest index j where a_j equals the sum of all the other cards.
Level

Easy1 of 10

Topics
Array, Math
Solved
No attempts yet

Problem

Ivan had nn cards, and each card had one integer from -100 to 100 written on it. He often rearranged them, and once he arranged them so that the sum of the first n−1n-1 numbers equals the last number, that is, ∑i=1n−1ai=an\sum\limits_{i=1}^{n-1} a_i = a_n. While Ivan was having lunch, his younger sister Alyona shuffled all the cards. Unfortunately, Ivan did not remember which number was equal to the sum of the others. Help Ivan find it.

Input

The first line contains one integer nn (2≤n≤1002 \le n \le 100), the number of cards. The second line contains nn integers aia_i (∣ai∣≤100|a_i| \le 100), the numbers written on the cards.

Output

Print the smallest index jj such that aja_j is equal to the sum of the numbers on all the other cards.

Examples1

  1. Example 1

    Input
    3
    1 3 2
    
    Expected output
    2