HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > Lab7 - CEN ECE > problem:


2012-10-01. 50573 - Count and Sum

Lab7 - CEN ECE

Start: Nov.14.2023 at 12:11:01 AM
Finish: Nov.21.2023 at 11:11:01 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 50387 - Passengers in the Train
• 50293 - Sum of odd numbers from ...
• 50452 - Multiplication Table
• 1. 50336 - Buying Carpets
• 15-FallPr-30. 50810 - Print Office
• 2012-10-01. 50573 - Count and ...
• 2014-04-20. 50548 - Albanian Airlines

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