diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-07-15 19:58:48 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-07-15 19:58:48 +0700 |
commit | be6678fbca007e73d69c9a9c5cddb8241a987149 (patch) | |
tree | e00165734b3b3ab2ca8d47e32ef5d7868b4804c3 /codechef/chfm.py | |
parent | 6c0ea3cc3364733e8d8fe7625b128f817d55b2cd (diff) | |
download | cp-be6678fbca007e73d69c9a9c5cddb8241a987149.tar.gz |
So I gave up on a number theory one
Diffstat (limited to 'codechef/chfm.py')
-rwxr-xr-x | codechef/chfm.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/codechef/chfm.py b/codechef/chfm.py new file mode 100755 index 0000000..99b3d99 --- /dev/null +++ b/codechef/chfm.py @@ -0,0 +1,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') |