You are given a sequence of positive integers a1, a2, ..., an. Find all such indices i, that the i-th element equals the arithmetic mean of all other elements (that is all elements except for this one).

Input

The first line contains the integer n (2 ≤ n ≤ 2·105). The second line contains elements of the sequence a1, a2, ..., an (1 ≤ ai ≤ 1000). All the elements are positive integers.

Output

Print on the first line the number of the sought indices. Print on the second line the sought indices in the increasing order. All indices are integers from 1 to n.

If the sought elements do not exist, then the first output line should contain number 0. In this case you may either not print the second line or print an empty line.

Examples

Input

5
1 2 3 4 5


Output

1
3 

Input

4
50 50 50 50


Output

4
1 2 3 4

Difficulty: EASY
Tags: Implementation

Complete search
Skill types: Complete search

Starter code:

Solutions:
m = int(input())
num = [int(n) for n in input().split()]
sum = 0
for i in range(0, m):
	sum += num[i]
if sum % m:
	print('0')
else:
	ave = sum // m
	cnt = 0
	for i in range(0, m):
		if num[i] == ave:
			cnt += 1
	print(cnt)
	for i in range(0, m):
		if num[i] == ave:
			print(i + 1, end=' ')


(n, t) = (int(input()), list(map(int, input().split())))
s = sum(t)
temp = [i + 1 for i in range(n) if t[i] * n == s]
print(len(temp))
print(' '.join(map(str, temp)))


n = int(input())
a = list(map(int, input().split()))
(q, r) = (sum(a), [])
for i in range(n):
	if (q - a[i]) / (n - 1) == a[i]:
		r.append(i + 1)
l = len(r)
if l == 0:
	print(0)
else:
	print(l, '\n', *r)


class CodeforcesTask134ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.sequence = []

	def read_input(self):
		self.n = int(input())
		self.sequence = [float(x) for x in input().split(' ')]

	def process_task(self):
		ss = sum(self.sequence)
		other_rests = [(ss - self.sequence[x]) / (self.n - 1) for x in range(self.n)]
		matching = [i + 1 for (i, x) in enumerate(other_rests) if self.sequence[i] == x]
		self.result = '{0}\n{1}'.format(len(matching), ' '.join([str(x) for x in matching]))

	def get_result(self):
		return self.result
Solution = CodeforcesTask134ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
l = [int(i) for i in input().split()]
sm = sum(l)
ans = []
for i in range(n):
	if l[i] == (sm - l[i]) / (n - 1):
		ans.append(i + 1)
print(len(ans))
print(*ans)


import os
import sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import *
from collections import defaultdict, deque, Counter
import math
import string
from heapq import *
from operator import add
from itertools import accumulate
BUFSIZE = 8192
sys.setrecursionlimit(10 ** 5)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
inf = float('inf')

def en(x):
	return list(enumerate(x))

def ceil_(a, b):
	return (a + b - 1) // b

def ii():
	return int(input())

def r():
	return map(int, input().split())

def rr():
	return list(r())
n = ii()
arr = rr()
x = sum(arr)
ans = []
for (j, i) in enumerate(arr):
	if (x - i) / (n - 1) == i:
		ans += (j + 1,)
print(len(ans))
print(*ans)


cin = input
n = int(cin())
a = [int(i) for i in input().split()]
s = sum(a)
b = [str(i + 1) for i in range(n) if a[i] * (n - 1) == s - a[i]]
print(len(b))
print(' '.join(b))


def moyenne():
	a = int(input())
	b = [int(x) for x in input().split()]
	z = sum(b)
	recup = [i + 1 for (i, x) in enumerate(b) if (z - x) / (a - 1) == x]
	return recup

def main():
	moy = moyenne()
	print(len(moy))
	print(*moy)
main()


n = int(input())
arr = list(map(int, input().strip().split()))
total = sum(arr)
answers = []
for (i, number) in enumerate(arr):
	if total - number == (n - 1) * number:
		answers.append(i + 1)
print(len(answers))
print(*answers)


n = int(input())
ls = list(map(int, input().split()))
sm = sum(ls)
arr = []
for i in range(n):
	if (sm - ls[i]) / (n - 1) == ls[i]:
		arr.append(i + 1)
print(len(arr))
for i in arr:
	print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
av = sum(a) / n
ans = []
for (i, j) in enumerate(a):
	if av == j:
		ans.append(i + 1)
print(len(ans))
print(*ans)


a = int(input())
l = list(map(int, input().rstrip().split(' ')))
s = sum(l)
c = 0
li = []
for i in range(a):
	if (s - l[i]) / (a - 1) == l[i]:
		li.append(i + 1)
		c += 1
if not c:
	print(0)
else:
	print(c)
	print(*li)


n = int(input())
a = list(map(int, input().split()))
v = sum(a)
ans = 0
b = []
for i in range(n):
	if (v - a[i]) / (n - 1) == a[i]:
		ans += 1
		b.append(i + 1)
print(ans)
print(*b)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
s = s / n
if s % 1 != 0:
	print('0')
	exit()
else:
	l = []
	g = 0
	for i in range(n):
		if a[i] == s:
			g = g + 1
			l.append(i + 1)
	print(g)
	for i in range(g):
		print(l[i], end=' ')


n = int(input())
ar = list(map(int, input().split()))
sm = sum(ar)
if sm // n * n != sm:
	print(0)
else:
	vl = sm // n
	print(ar.count(vl))
	print(*[x + 1 for x in range(n) if ar[x] == vl])


n = int(input())
a = [int(c) for c in input().split()]
k = sum(a) / len(a)
b = []
for i in range(len(a)):
	if a[i] == k:
		b.append(i + 1)
print(len(b))
print(*b)


n = int(input())
a = list(map(int, input().split()))
cnt = []
s = sum(a)
for i in range(len(a)):
	avg = (s - a[i]) / (len(a) - 1)
	if avg == a[i]:
		cnt.append(i + 1)
if len(cnt) == 0:
	print('0')
else:
	print(len(cnt))
	for i in range(len(cnt)):
		print(cnt[i], end=' ')


import sys
n = int(input())
s = [*map(int, sys.stdin.readline().split())]
su = sum(s)
ch = 0
a = []
for i in range(n):
	if (su - s[i]) / (n - 1) == s[i]:
		ch += 1
		a.append(i + 1)
print(ch)
print(*a)


n = int(input())
f = []
l = list(map(float, input().split()))
s = sum(l)
for i in range(len(l)):
	if (s - l[i]) / (n - 1) == l[i]:
		f.append(i + 1)
print(len(f))
f.sort()
print(*f)


n = int(input())
a = list(map(int, input().split()))
(q, r) = (sum(a), [])
r = [str(i + 1) for i in range(n) if a[i] * n == q]
print(len(r), '\n', ' '.join(r))


n = int(input())
num = list(map(int, input().split()))
count = []
sm = sum(num)
for i in range(n):
	if (sm - num[i]) / (n - 1) == num[i]:
		count.append(i + 1)
print(len(count))
for i in range(len(count)):
	print(count[i], end=' ')


N = int(input())
ar = [int(x) for x in input().split()]
ans = []
s = sum(ar)
for (i, j) in enumerate(ar):
	if j * N == s:
		ans.append(str(i + 1))
print(len(ans))
print(' '.join(ans))


n = int(input())
a = list(map(int, input().split()))
count = 0
ind = []
total = sum(a)
for i in range(n):
	if a[i] == (total - a[i]) / (n - 1):
		count += 1
		ind.append(i + 1)
print(count)
print(*ind)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
v = [str(i + 1) for (i, ai) in enumerate(a) if (n - 1) * ai == s - ai]
print(len(v))
print(' '.join(v))


n = int(input())
A = [int(i) for i in input().split(' ')]
res = 0
ans = []
avg = sum(A) / n
for i in range(n):
	if A[i] == avg:
		res += 1
		ans.append(i + 1)
print(res)
print(*ans)


n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in a:
	sum += i
sum = sum / len(a)
res = []
num = 0
for i in range(len(a)):
	if a[i] == sum:
		res.append(i + 1)
		num += 1
print(num)
print(*res)


n = int(input())
a = list(map(int, input().split()))
(s, ans) = (sum(a), [])
for i in range(n):
	if (s - a[i]) / (n - 1) == a[i]:
		ans.append(i + 1)
print(len(ans))
print(*ans)


n = int(input())
a = [int(i) for i in input().split()]
d = sum(a)
flag = 0
l = []
for i in range(0, len(a)):
	e = d - a[i]
	mean = e / (n - 1)
	if a[i] == mean:
		l.append(i + 1)
if len(l) > 0:
	print(len(l))
	print(*l)
else:
	print(0)


n = int(input())
v = list(map(int, input().split(' ')))
s = sum(v)
inds = list()
for (c, it) in enumerate(v):
	if (s - it) / (n - 1) == it:
		inds.append(c)
print(len(inds))
for c in inds:
	print(c + 1, end=' ')


n = int(input())
a = input().split()
a = [int(x) for x in a]
mean = sum(a) / n
list1 = []
for (i, x) in enumerate(a):
	if x == mean:
		list1.append(i + 1)
print(len(list1))
for x in list1:
	print(x, end=' ')


import sys
S = sys.stdin.read()
S = [int(x) for x in S.split('\n')[1].split()]
s = sum(S)
n = len(S)
T = [i + 1 for i in range(n) if n * S[i] == s]
print(len(T))
print(' '.join([str(x) for x in T]))


import sys
import math
n = int(input())
an = [int(x) for x in sys.stdin.readline().split()]
vsum = sum(an)
res = []
c = 0
for i in range(n):
	if (vsum - an[i]) / (n - 1) == an[i]:
		res.append(str(i + 1))
		c += 1
print(c)
print(' '.join(res))


def main():
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	res = list()
	for i in range(len(a)):
		if (s - a[i]) / (n - 1) == a[i]:
			res.append(i + 1)
	print(len(res))
	if len(res) > 0:
		print(' '.join(map(str, res)))
main()


import math
n = int(input())
lst = list(map(int, input().strip().split(' ')))
s = sum(lst)
l = []
c = 0
for i in range(n):
	if lst[i] == (s - lst[i]) / (n - 1):
		c += 1
		l.append(i + 1)
if c == 0:
	print(0)
else:
	print(c)
	for j in range(len(l)):
		print(l[j], end=' ')


n = int(input())
l = list(map(int, input().split()))
a = []
c = 0
s = sum(l)
for i in range(0, n):
	if l[i] == ((s - l[i]) % (n - 1) == 0 and (s - l[i]) // (n - 1)):
		c += 1
		a.append(i + 1)
print(c)
for i in a:
	print(i, end=' ')


n = int(input())
A = list(map(int, input().split()))
B = []
srar = 0
for i in range(n):
	srar += A[i]
srar = srar / n
for i in range(n):
	if (srar * n - A[i]) / (n - 1) == A[i]:
		B.append(i + 1)
print(len(B))
for i in range(len(B)):
	print(B[i], end=' ')


n = int(input())
l = list(map(int, input().split()))
d = []
c = 0
s = sum(l)
for i in range(n):
	if l[i] * n == s:
		d.append(i + 1)
		c = c + 1
print(c)
print(*d)


n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
count = 0
ans = []
for x in range(n):
	if arr[x] == (s - arr[x]) / (n - 1):
		count = count + 1
		ans.append(x + 1)
print(count)
for x in ans:
	print(x, end=' ')
print()


a = int(input())
k = a - 1
l = list(map(int, input().split()))
s = sum(l)
count = 0
l1 = []
for i in range(0, len(l), 1):
	if (s - l[i]) % k == 0:
		if (s - l[i]) // k == l[i]:
			count += 1
			l1.append(i + 1)
print(count)
for i in l1:
	print(i, end=' ')
print()


numElems = int(input())
elems = [int(x) for x in input().split()]
sumElems = sum(elems)
output = []
i = 1
for elem in elems:
	if (sumElems - elem) / (numElems - 1) == elem:
		output.append(i)
	i += 1
print(len(output))
for i in range(len(output)):
	if i >= len(output) - 1:
		print(output[i], end='')
	else:
		print(output[i], end=' ')


import math
n = int(input())
arr = list(map(int, input().split()))
vrr = []
ms = int(sum(arr))
for i in range(len(arr)):
	ans = (ms - arr[i]) / (n - 1)
	if arr[i] == (ms - arr[i]) / (n - 1):
		vrr.append(i + 1)
if len(vrr) > 0:
	print(len(vrr))
	print(*vrr)
else:
	print(0)


n = int(input())
L = list(map(int, input().split()))
s = sum(L)
Ans = ''
cnt = 0
for i in range(n):
	x = (s - L[i]) // (n - 1)
	if x * (n - 1) != s - L[i]:
		continue
	if x == L[i]:
		Ans += str(i + 1) + ' '
		cnt += 1
print(cnt)
if cnt != 0:
	print(Ans)


a = int(input())
l = list(map(int, input().split()))
s = sum(l)
avgindex = []
for i in range(len(l)):
	if l[i] * a == s:
		avgindex.append(i + 1)
print(len(avgindex))
for i in range(len(avgindex)):
	print(avgindex[i], end=' ')


n = int(input())
a = [int(c) for c in input().split()]
tot = sum(a)
b = [i + 1 for (i, c) in enumerate(a) if c * n == tot]
print(len(b))
print(*b)


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
ans = []
for i in range(0, n):
	mean = (s - l[i]) / (n - 1)
	if mean == l[i] and int(mean) == mean:
		ans.append(i + 1)
print(len(ans))
print(' '.join([str(i) for i in ans]))


n = int(input())
a = list(map(int, input().split()))
b = []
s = 0
for i in a:
	s += i
for i in range(n):
	if a[i] == (s - a[i]) / (n - 1):
		b.append(i + 1)
print(len(b))
print(*b, sep=' ')


a = int(input())
mas = list(map(int, input().split(' ')))
b = 0
suma = 0
k = 0
kol = []
for i in range(a):
	suma += mas[i]
suma /= a
for i in range(a):
	if mas[i] == suma:
		kol.append(i)
		k += 1
print(k)
if k != 0:
	for i in range(len(kol)):
		print(kol[i] + 1, end=' ')


I = input
n = int(I())
a = list(map(int, I().split()))
s = sum(a)
v = []
for i in range(n):
	if a[i] == (s - a[i]) / (n - 1):
		v += [str(i + 1)]
P = print
P(len(v))
P(' '.join(v))


import sys
import math
n = int(input())
l = [int(i) for i in input().split()]
l1 = []
s = sum(l)
c = 0
for i in range(n):
	if l[i] == (s - l[i]) / (n - 1):
		c += 1
		l1.append(i + 1)
print(c)
print(*l1)


n = int(input())
arr = [int(i) for i in input().split(' ')]
s = 0
result = []
for item in arr:
	s += item
s = s / n
count = 0
pos = 1
for item in arr:
	if item == s:
		count += 1
		result.append(str(pos))
	pos += 1
print(count)
print(' '.join(result))