#K94352. Final Score Calculation

    ID: 38622 Type: Default 1000ms 256MiB

Final Score Calculation

Final Score Calculation

You are given scores assigned by five judges. Your task is to compute the final score by discarding the highest and lowest scores and then averaging the remaining three scores using integer division.

If the input does not contain exactly five scores, the program should report an error. The computation is defined as follows:

Let \( s_1, s_2, s_3, s_4, s_5 \) be the five scores. After sorting these scores in non-decreasing order, discard the smallest and largest values. Then, the final score is computed as:

\[ \text{final score} = \frac{s_2 + s_3 + s_4}{3} \]

Note that all operations are performed using integer arithmetic.

inputFormat

A single line containing exactly five space-separated integers representing the scores from five judges. For example: "15 99 50 76 88"

outputFormat

Print a single integer representing the final score after discarding the highest and lowest scores and averaging the remaining three scores using integer division.## sample

15 99 50 76 88
71

</p>