From be6678fbca007e73d69c9a9c5cddb8241a987149 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Mon, 15 Jul 2019 19:58:48 +0700 Subject: So I gave up on a number theory one --- codechef/chfm.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 codechef/chfm.py (limited to 'codechef/chfm.py') 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') -- cgit 1.4.1