#P6363. Score Ranking in Software Engineering Course
Score Ranking in Software Engineering Course
Score Ranking in Software Engineering Course
A university offers a mandatory course named Software Engineering which is divided into a theoretical part and a practical part. The theoretical part is taught by the university professors, while the practical part is led by a third‐party company. In the practical part, students are required to self‐learn technologies such as HTML, CSS, JavaScript, Vue, Python, Django, etc., form teams and complete a real-world internet commercial application within five weeks.
There are \(n\) students (where \(0 \le n \le 1000\)) enrolled in this course. The students are divided into at most 26 teams. Each team is identified by an uppercase letter from A
to Z
. Every team completes a project, and each team (including itself) gives a score to every team’s project, with scores being integers in the range \([0, 100]\).
To ease the students' complaints (for example, about excessive workload, time pressure, or unfair evaluation), the instructor decides to use the following seemingly fair method to determine the project score for each team:
- For a given team, first compute the average of all scores it receives from all teams (including its own score). Denote this average by \(\bar{x}\).
- Discard those scores whose difference with \(\bar{x}\) is strictly greater than 15, i.e. discard any score \(s\) for which \(|s-\bar{x}| > 15\). (It is guaranteed that not all scores will be discarded.)
- Compute the average of the remaining scores and round it to the nearest integer (using round half up) to obtain the team’s project score.
Each student has a theoretical score (an integer between 0 and 100) and belongs to one team. A student's final score is calculated as follows:
\[ \text{Final Score} = \text{round}(0.6 \times \text{(theoretical score)} + 0.4 \times \text{(project score)}) \]
(The rounding is done using the normal round half up method.)
Your task is to output the ranking for all students sorted in descending order of their final scores. For each student, print the final score and the team code they belong to.
inputFormat
The input is given in the following format:
n team1 theory_score team2 theory_score ... team_n theory_score t r1_1 r1_2 ... r1_t r2_1 r2_2 ... r2_t ... r_t_1 r_t_2 ... r_t_t
Here:
n
is the number of students (\(0 \le n \le 1000\)).- Each of the next
n
lines contains a team code (an uppercase letter) and an integer representing the student's theoretical score. t
is the number of teams that participated in rating the projects (\(1 \le t \le 26\)). It is assumed that the teams are identified by the firstt
uppercase letters (A
,B
, ...).- The following
t
lines each containt
integers. The i-th line represents the ratings given by team corresponding to the i-th letter. The j-th integer on that line is the score that that team gave to the project of team corresponding to the j-th letter.
outputFormat
Output each student's final score followed by a space and their team code, one student per line, ordered by descending final score.
sample
5
A 80
B 75
A 90
C 85
B 70
3
80 70 60
70 80 75
60 70 80
82 A
79 C
76 A
75 B
72 B