#C14223. Students with High Grades
Students with High Grades
Students with High Grades
You are given a list of student names with their corresponding grades. Your task is to filter out the students whose grades are below (70) and then output the names of those students whose grades are at least (70), arranged in descending order of their grades. In the case where multiple students have the same grade, maintain their original order as given in the input.
For instance, if the input is:
4
John 85
Jane 92
Doe 50
Alice 70
then the expected output is:
Jane John Alice
inputFormat
The input begins with an integer (n) on the first line denoting the number of students. Each of the following (n) lines contains two elements separated by a space: the student's name (a string) and the student's grade (an integer).
outputFormat
Output a single line containing the names of the students whose grades are at least (70), sorted in descending order by their grade. The names must be separated by a space. If no student meets the condition, output an empty line.## sample
4
John 85
Jane 92
Doe 50
Alice 70
Jane John Alice