Array Mean

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Java, Lisp, Rust

You're given an array of length N. Find all of the values in the array that are larger than the mean of the array, rounded down. You are to output the values from the left-most index of the array to the right-most index.

Input Specification

The first line will contain the integer N (1 \leq N \leq 100), the length of the array.

The next N lines will each contain an integer, representing the value of that array. These values will all be in between -100 and 100.

Output Specification

For each number that you find that is larger than the mean of the array rounded down, output it on a separate line.

Sample Input 1

5
1
2
3
4
5

Sample Output 1

4
5

Sample Explanation

The mean of this array is 3, and the numbers that are larger than that are 4 and 5.

Sample Input 2

8
5
2
14
29
8
10
11
3

Sample Output 2

14
29
11

Sample Explanation 2

The mean this array is 10.25, rounded down to 10. Thus, only those three values are larger than 10, thus being the answers.


Comments

There are no comments at the moment.