• 1
    Input and Output Data
    • Tasks
  • 2
    Conditions
    • Tasks
  • 3
    For Loop
    • Tasks
  • 4
    Strings
    • Tasks
  • 5
    While Loop
    • Tasks
  • 6
    Lists
    • Tasks
  • 7
    Two-Dimensional Arrays
    • Tasks
  • 8
    Dictionaries
    • Tasks
  • 9
    Sets
    • Tasks
  • 10
    Functions and Recursion
    • Tasks
  • к

Занятие 10. Functions and recursion

Difficulty level:

Task«Employee performance analysis system»

the company uses a system for evaluating employees according to various criteria. For each employee, his assessments are known for several parameters. It is necessary to create a function -generator that will return employees in decreasing their average assessment, but with memory optimization - processing data on one employee at a time.

Input format

The first line contains the number of N. The following are n lines, each contains the name of the employee and its assessment through the gap. The name consists of one word, assessment - integers from 1 to 10

Output format

the names of employees in the order of descending an average grade, each name on a new line. With the equality of average assessments, sorting by alphabet

Example

Input

3
Ivan 8 9 7
Maria 9 10 8
Peter 6 7 8

Output

Maria
Ivan
Peter

Hint

There will be no clue here, decide for yourself!

main.py
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6
Test 7
Test 8
Test 9
Test 10
Developer’s solution

🎉 Congratulations! 🎉

You did an excellent job with the task! It was a challenging problem, but you found the correct solution. You are one step closer to mastering programming! Keep up the good work, because every stage you pass makes you even stronger.

AD

Advertisement

red-snake blue-snake green-snake

Running your code...

Помощник ИИ

Привет! Я твой помощник по программированию. Задавай любые вопросы по Python, я могу рассказать о функциях, методах, обьяснить то, что тебе не понятно, а так же о текущей задаче!