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

Разделы > Сортировка и последовательности > задача:


50364 - Student averages

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

Задачи раздела

• 50492 - Contest Scoreboard
• 50320 - Random Sorted List
• 50738 - Median value
• 50317 - Student Line Up
• 50311 - Student Line Up
• 50736 - Top N Donors - 2
• 50333 - Series of Squares
• 50734 - Product Info (In Srt)
• 50364 - Student averages
• 50733 - The Highest Average
• 50358 - Series of Odd Numbers
• 50756 - Average of the Nth Student
• 50347 - Selling Oranges
• 50758 - National Elections - Revisited
• 50757 - National Elections - 1
• 50755- Top N Donors - 1
• 50290 - Minimax Sum

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

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

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

Student averages

Your math professor keeps student grades in a file. Time to time, he wants to see student lists sorted according to averages.

Question:
Write a program that reads student names surnames and 4 marks for every student. Then, your program will show top m students sorted in descending order according to the averages.

Input specification
The first line of the input contains two integers (n and m) where n denotes the number of students and m denotes the number of top students to show in the output where 1 ≤ m ≤ n ≤ 600. Each of the following n lines will have:

  • Name: At most 15 chars string containing only English letters.
  • Surname: At most 15 chars string containing only English letters.
  • 4 Marks: 4 integer numbers between 0 and 100

Output specification
Show top m students' names surnames and averages (with 2 decimal places after the floating point).

Sample Input I   
  6 3
  Erma Gomez 89 81 76 69
  Geraldine Craig 40 69 73 49
  Margie Reid 44 55 63 63
  Barbara Bennett 96 54 75 77
  Christopher Hampton 48 72 59 87   
  Carmen Horton 56 68 90 84
Sample Output I   
  Erma Gomez 78.75
  Barbara Bennett 75.5   
  Carmen Horton 74.5


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

www.contester.ru