ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


51182 - Count and Sum 2

Задачи сборника

• 50791 - Mine field
• Trip to Librazhd
• 50912 - Trip to Librazhd
• 50914 - Buy 3, Pay 2
• 50563 - Modul i gjate
• 50565 - Numra binare
• 50569 - Lendet me zgjedhje per kla...
• 50594 - Transformimet
• 51182 - Count and Sum 2
• 51193 - The max element of k-th co...
• 51196 - The sum of two arrays
• 51197 - Even and odd Numbers
• s
• s
• 010. 50381 - Sum of the numbers
• 125. 50538 - Sum of kth Diagonal
• 140. 50599 - Shuma e katroreve te ...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Sum of numbers over the average

Count and calculate the sum of numbers which are greater than the average.

You will be first given one number (n) which is followed by a series of integers (n space-separated positive values). Count the numbers and calculate the sum of those numbers as far as the numbers in the series are greater than the average.

Input specification
You will be given one integers (n) in the first line,   and 1 ≤ n ≤ 10.000. The second line contains a series of integer numbers a[n] where   0 < a[n] ≤ 10.

Output specification
You will give three numbers, the average (with 2 digits after the floating point number),  cnt and sum  as integer, where
   avg is the average of all numbers; 
   cnt is the number of numbers which are greater than the average; and
   sum is the sum of those numbers.
Clearly, if there is no number satisfying the given condition, cnt and sum will have the values 0 (zero).

Sample Input I 

5 8 4 9 3   

Sample Input II
7
4 10 8 5 8 9 7

Sample Output I
5.80 2 17 

Sample Output II
7.29 4 35

Explanation of the Output 1:
The average si 5.80 and there are two numbers greater than 5.80 and their sum is 17.

Для отправки решений необходимо выполнить вход.

www.contester.ru