#P1431. Find the Counterfeit Coin

    ID: 14717 Type: Default 1000ms 256MiB

Find the Counterfeit Coin

Find the Counterfeit Coin

You are given a bag containing \( n \) coins. Among these coins, exactly one is counterfeit, and its weight is different from that of the genuine coins. Your task is to identify the counterfeit coin.

To help you, a balance scale is provided that can compare the weights of two groups of coins, determining whether the weights are equal. However, in this problem you will be given the weights of the coins directly, and you need to determine the index (1-indexed) of the coin whose weight differs from the others.

Note: It is guaranteed that there is exactly one counterfeit coin.

inputFormat

The first line contains an integer \( n \) (\( 1 \le n \le 10^5 \)), the number of coins.

The second line contains \( n \) space-separated integers representing the weights of the coins. All coins have the same weight except for one counterfeit coin.

outputFormat

Output a single integer representing the 1-indexed position of the counterfeit coin.

sample

5
10 10 9 10 10
3

</p>