#C12806. Filter Elements Above Average
Filter Elements Above Average
Filter Elements Above Average
You are given a list of integers. Your task is to output all elements that are strictly greater than the average of the list. The average is calculated as $$\frac{\sum_{i=1}^{n}a_i}{n}$$. The order of the output must follow the original order.
If the list is empty or no element is greater than the average, print an empty line.
inputFormat
The input is read from standard input (stdin). The first line contains an integer (n) ((n \ge 0)), which represents the number of elements in the list. If (n > 0), the second line contains (n) space-separated integers.
outputFormat
Print to standard output (stdout) a single line with the integers that are strictly greater than the average of the original list, separated by a single space. If no element qualifies, output an empty line.## sample
5
10 20 30 40 50
40 50