#K52462. Student Performance Categories
Student Performance Categories
Student Performance Categories
You are given information about a group of students. For each student, their name and scores in three subjects (math, science, and English) are provided. Your task is to compute the average score using the formula $$\text{average} = \frac{\text{math}+\text{science}+\text{english}}{3}$$ and then categorize the student's performance into one of the following bands:
- Excellent: if average \(\geq 90\)
- Good: if \(80 \leq \text{average} < 90\)
- Average: if \(70 \leq \text{average} < 80\)
- Poor: if \(60 \leq \text{average} < 70\)
- Fail: if average \(< 60\)
Print each student's name along with the corresponding performance band on a separate line, maintaining the input order.
inputFormat
The input is read from standard input (stdin). The first line contains an integer T representing the number of students. Each of the following T lines contains a student's name followed by three integers which represent the scores in math, science, and English respectively, separated by spaces.
outputFormat
For each student, output a single line to standard output (stdout) containing the student's name and their performance band, separated by a space. The order of the outputs should be the same as the order of input.## sample
5
Alice 80 85 90
Bob 60 60 60
Charlie 70 75 80
Dave 90 95 85
Eva 50 50 50
Alice Good
Bob Poor
Charlie Average
Dave Excellent
Eva Fail
</p>