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

Сборники > Фёдор Меньшиков. Тренировки > задача:


50867 - Average of the Best Grades

Гость
• Вопросы к жюри (1)

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

• 50744 - The Smallest Perimeter
• 50808 - Total Distance Traveled
• 50814 - Buying Books from Internet
• 50812 - Total Discount for the clients
• 50832 - Rock Paper Scissors Lizard ...
• 51078 - Max trade
• 51077 - Grades Histogram
• 51046 - The biggest number
• 50867 - Average of the Best Gr...
• Reflektimi i pikes
• 50994 - The Most Crowded Station
• 51194 - The difference between max...
• 001. 50385 - From m to n
• 002. 50365 - Sum of the numbers f...
• 002. 50452 - Multiplication Table
• 002. 50554 - Fuqia e n-t e m (2)
• 003. 50387 - Passengers in the Train

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan and Sidrit Reka.

Average of the Best Grades

Question: A math professor who is very interested into statistics wants to calculate the average of the best grades of his students. So, he will take the best grade of each student and then he will calculate their average.

Question: Given the number of students and the grades of each student, find the average of the best grade of each student.

Input specification
In the first line you will be given a number n (3 <= n <= 10.000) which determines the number of students. In the following n lines, you will be given a list of integer grades (1 <= grade <= 100) which ends with -1. Each line determines the grades of each student.

Output specification:
Write the average of the best grades of each student with 2 digits precision.

Sample Input I
3
5 31 57 77 19 -1
27 96 11 60 47 58 -1
90 72 42 -1
Sample Input II
5
9 27 33 81 78 93 3 -1
8 79 32 20 77 -1
68 72 38 -1
79 1 20 5 55 92 -1
92 15 22 12 -1
Sample Output I
87.67
Sample Output II
85.60

Explanation Sample Input I: The best grade of the first student is 77. The best grade of the second student is 96. The best grade of the third student is 90. The average of the best grades is (77 + 96 + 90) / 3 = 87.67

Explanation Sample Input II: The best grade of the first student is 93. The best grade of the second student is 79. The best grade of the third student is 72. The best grade of the fourth student is 92. The best grade of the fifth student is 92. The average of the best grades is (93 + 79 + 72 + 92 + 92) / 5 = 85.60



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

www.contester.ru