134A.md (1098B)
1 Source: https://codeforces.com/problemset/problem/134/A 2 3 A. Average Numbers 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 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). 22 23 Input 24 25 The first line contains the integer *n* (2 ≤ *n* ≤ 2·105). The second line contains elements of the sequence *a*1, *a*2, ..., *a**n* (1 ≤ *a**i* ≤ 1000). All the elements are positive integers. 26 27 Output 28 29 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*. 30 31 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. 32 33 Examples 34 35 Input 36 37 ``` 38 5 39 1 2 3 4 5 40 ``` 41 42 Output 43 44 ``` 45 1 46 3 47 ``` 48 49 Input 50 51 ``` 52 4 53 50 50 50 50 54 ``` 55 56 Output 57 58 ``` 59 4 60 1 2 3 4 61 ```