Score Tally
Time limit1sMemory limit128 MB
Drop the highest and lowest of five judge scores, print KIN when the remaining three span 4 or more, else print their sum.
- Level
Easy1 of 10
- Topics
- Sorting, Implementation
- Solved
- No attempts yet
Problem
The Korean Gymnastics Association is changing how it tallies scores so that one bad call counts for less. Under the old rule, five judges each give an integer score from 1 to 10, one highest score and one lowest score are dropped, and the sum of the remaining three is the total. Under the new rule, if the highest and the lowest of those three remaining scores differ by 4 or more, the scores are adjusted and the routine is judged again.
Write a program that tallies the scores and prints the total, or prints KIN (Keep In Negotiation) instead of the total when the scores have to be adjusted and given again.
Input
The first line has the number of test cases ().
Each of the next lines has the five integer scores (, ) given by the five judges, separated by single spaces.
Output
For each test case, print the total on its own line. If the scores have to be adjusted and given again, print KIN instead of the total.