HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Search > problem:


50573 - Count and Sum

Guest
• Review clarifications (2)

Section problems

• 50867 - Average of the Best Grades
• 50782 - Max of N integers
• 50460 - Median of 3 Numbers
• 50552 - Casual shoes
• 50558 - Biggest Barn
• 50562 - List of students
• 50566 - Grade Point Average (GPA)
• 50570 - Prime numbers in the seg...
• 50573 - Count and Sum
• 50575 - Number of Prime numbers
• 50576 - Number of Perfect numbers
• 50586 - Prime Palindromes
• 50588 - Processing the list of numbers
• 50589 - The Number of Eggs Sold
• 50783 - The smallest number
• 50792 - The student with the highest...
• 50547 - Close Pair

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Count and Sum

Shqip

The school Math professor wants to see his class average and the percentage of the class who are over certain grade value (k). In order to make these calculations, he has prepared a sheet for the grades and he wants to count the number of students who have taken over the certain grade (k) and the sum of those grades (to use in future average calculations).

You will be first given two numbers (k, n) which are 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 given value (k).

Input specification
You will be given two integers (k and n) in the first line,   1 ≤ k ≤ 10 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 only two integer numbers cnt and sum where
   cnt is the number of numbers which are greater than the given number k; 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
7 5
5 8 4 9 3           

Sample Output I
2 17
Explanation of the Output:
There are two numbers greater than 7 and their sum is 17.
Sample Input II
7 7
4 10 8 5 8 9 7

Sample Output II
4 35



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

www.contester.ru