1817. geolocation Grand Prix

Source: Internet
Author: User

1817. geolocation Grand Prix

Description

Each jury in the contestant Grand Prix will rate each contestant. Use the class to describe the ratings of each contestant by the judges. The contestant scoring rule is to remove one highest score and one lowest score, and then calculate the average score. program the score of a contestant.

 

Input

There are multiple groups of input data. The first behavior data group is T.

The first row of each data group has two positive integers, n m (3 <= n, m <= 100), indicating that there are n evaluation committees and M contestants.

Next n rows, each row has M positive integers. Each row represents the score given to M contestants by a judge. The score is an integer of [0,100.

 

Output

Output the result to output m rows of input data in each group. Each row indicates the score of a contestant, and the result is retained with two decimal places.

 

Sample Input

 
13 41 2 3 41 2 3 41 2 3 4
Sample output

 
1.002.003.004.00

// Source code of submission 980815, Zhongshan University Online judge system # include <stdio. h> # define maxlen 100int main () {int t, n, m; int I, j; float average; int score [maxlen] [maxlen]; int MAX [maxlen]; int Min [maxlen]; scanf ("% d", & T); While (t --) {scanf ("% d", & N, & M ); for (I = 0; I <m; I ++) {max [I] = 0; Min [I] = 100;} for (I = 0; I <N; I ++) {for (j = 0; j <m; j ++) {scanf ("% d", & score [I] [J]); if (score [I] [J]> MAX [J]) Max [J] = score [I] [J]; if (score [I] [J] <min [J]) min [J] = score [I] [J] ;}} for (j = 0; j <m; j ++) {average = 0; for (I = 0; I <n; I ++) {average + = score [I] [J];} average = (average-MAX [J]-min [J])/(n-2); printf ("%. 2f \ n ", average) ;}} return 0 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.