#K71637. Sort Students
Sort Students
Sort Students
You are given a list of students and their scores. Each record is provided in the format " ". Your task is to sort these student records according to the following criteria:
- Descending order of scores.
- If two or more students have the same score, sort them in ascending alphabetical order by their names.
Mathematically, if a student's record is represented as ((name_i, score_i)), then the sorting key is:
$$(-score_i, name_i)$$. The input terminates with a line containing only the string "END". Your output should display the sorted student records, each on a new line, with the name and the score separated by a space. ## inputFormat The input consists of multiple lines. Each line contains a student's name followed by a space and their score (an integer). The last line of the input is the word "END", which signals the end of input. You must read from standard input (stdin). ## outputFormat Output the sorted list of student records. Each student record should be printed on a new line in the format "Alice 85
Bob 95
Charlie 85
David 90
END
Bob 95
David 90
Alice 85
Charlie 85
$$