300706: CF134A. Average Numbers
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Average Numbers
题意翻译
给定n个正整数a1,a2……an,求出所有的i,使得ai与其他所有整数的算术平均值相等; 输入:共两行,第一行一个整数n,n∈[2,200000],第二行共n个整数a1,a2……an,且a1,a2……an∈[1,1000],每两个整数之间用空格隔开。 输出:共两行,第一行为符合条件的i的个数;第二行为所有符合条件的i。如果没有符合条件的i,请在第一行输出0,这时,可以输出一个空行,也可以不输出。 感谢@daifucong 提供的翻译题目描述
You are given a sequence of positive integers $ a_{1},a_{2},...,a_{n} $ . 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).输入输出格式
输入格式
The first line contains the integer $ n $ ( $ 2<=n<=2·10^{5} $ ). The second line contains elements of the sequence $ a_{1},a_{2},...,a_{n} $ ( $ 1<=a_{i}<=1000 $ ). All the elements are positive integers.
输出格式
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.
输入输出样例
输入样例 #1
5
1 2 3 4 5
输出样例 #1
1
3
输入样例 #2
4
50 50 50 50
输出样例 #2
4
1 2 3 4