about summary refs log tree commit diff
path: root/codechef/chfm.py
blob: 99b3d996264e8d7eb2d0dab9510938538a891261 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python3
for _ in range(int(input())):
    input()
    a = [int(i) for i in input().split()]
    d, m = divmod(sum(a), len(a))
    if m:
        print('Impossible')
        continue
    try:
        print(a.index(d) + 1)
    except ValueError:
        print('Impossible')