#K76182. Player Ranking System
Player Ranking System
Player Ranking System
In this problem, you are given a list of integers representing the points collected by a player from various actions during a game. Your task is to calculate the player’s rank based on the total points. The ranking is determined using the following conditions:
(\textbf{Legend}:) if (\sum_{i=1}^{n} points_i \geq 500).
(\textbf{Master}:) if (300 \leq \sum_{i=1}^{n} points_i < 500).
(\textbf{Apprentice}:) if (100 \leq \sum_{i=1}^{n} points_i < 300).
(\textbf{Novice}:) if (\sum_{i=1}^{n} points_i < 100).
Please read the input, compute the total points, and output the correct rank accordingly.
inputFormat
The input is provided via standard input (stdin).
The first line contains an integer (n) representing the number of actions. The second line contains (n) space-separated integers, each representing the points from each action. If (n = 0), the second line will be empty.
outputFormat
Output a single line to standard output (stdout) containing the player’s rank. The rank will be one of the following: Legend, Master, Apprentice, or Novice.## sample
3
300 200 100
Legend