Read a class's exam results and print a leaderboard.
Input. An integer n (n ≥ 0), then n lines each with a name (one word, no spaces) and an integer score.
Output. If n is 0, print No students. and stop. Otherwise sort the students by score, highest first; students with equal scores are ordered by name in natural (alphabetical) order. Print one line per student: rank. name score. Tied students share a rank, and the next rank skips accordingly (1, 1, 3, …). Finally print Average: followed by the mean score rounded to one decimal place (use Math.round(avg * 10) / 10.0).
Build the ordering with Comparator.comparing, reversed and thenComparing, and compute the average with a stream.
Input:
4
Lina 92
Omar 85
Bea 92
Zed 70
Output:
1. Bea 92
1. Lina 92
3. Omar 85
4. Zed 70
Average: 84.8