| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 138 | 38 | 25 | 30.120% |
You are given an array $a$ of $n$ integers. Find any index $i$ (1ドル \le i \le n$) such that the element $a_i$ equals to the geometric mean of all the other elements. In other words, find any index $i$ that satisfies the following formula: $$ a_i = \root{n-1}\of{\prod_{\substack{k=1 \\ k \neq i}}^n a_k}\text{.} $$
The first line contains one integer $n$ (2ドル \leq n \leq 10^5$): the length of the array.
The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($a_k \geq 1$; the total number of digits in all numbers does not exceed 300ドル,000円$).
It is guaranteed that the answer exists for the given array.
Output one integer: the index of the element that equals to geometric mean of the others items. It there are several answers, output any one of them.
5 2 4 8 16 32
3
2 123456789012345678901234567890 123456789012345678901234567890
2