ACM-ICPC INC 2008 Qualification

Problem B

Converting Numbers

Time Limit: 3s

Some old competitions still use 100-points scoring system where each competitor will score vary between 0 and 100 based on their performances on the given problems, just like school/college exam scoring system. This system cannot be applied if the relative performance among competitors that needs to be found.

For example, the left figure shows that most of the competitors' scores are quite high. This could be caused by either the competitors are much better than expected, or the competition project/problem is too easy. In other hand, the right figure shows that most of the competitor's scores are quite low.



Most competitions nowadays use a 400 - 600 norm based system (also called as 500 scaling system). Here you will be given a series of numbers (between 0-100) representing each competitor's score and you have to convert those numbers into 400 - 600 scaling system.

The conversion steps are as follows:
  • AVG, the average score will be the total score for all competitors in 100-points system divided by the number of competitors. (Xi = i-th competitor's score; N = number of competitors).
  • SD, the standard deviation will be calculated using this formula:
  • AVG will be converted into 500 points (the center) in norm-based system.
  • AVG + (3 x SD) will be converted into 600 points (the right most) in norm-based system.
  • AVG - (3 x SD) will be converted into 400 points (the left most) in norm-based system.
  • If the result is not between 400 and 600, round it to nearest end (either 400 or 600).


Example 1:
Let there be three competitors which scores are 20, 30 and 40. Using the formula above we will find that the average score (AVG) is 30 and the standard deviation (SD) is 10. The left most (400 points) will be 0 and the right most (600 points) will be 60. So {20, 30, 40} in 0 ~ 60 scale will be converted normally into {467, 500, 533} in 400 – 600 scale.

Example 2:
Let there be seven competitors which scores are 20, 30, 40, 50, 60, 70 and 70.56. Using the formula we will find that AVG is 48.937143 and SD is 20.004358. The left most (400 points) will be -11.07593 and the right most (600 points) will be 108.950216. So {20, 30, 40, 50, 60, 70, 70.56} in -11.07593 ~ 108.950216 scale will be converted normally into {451.78, 468.44, 485.11, 501.77, 518.43, 535.10, 539.36} in 400 – 600 scale.
Input The first line of input contains an integer T, the number of test cases follow.

Each test case begins with an integer N (1 <= N <= 1000) the number of competitors followed by string S (1 <= |S| <= 20) denoting the competition's name. S may contain alphanumeric ('a'-'z', 'A'-'Z', '0'-'9') or hyphen mark ('-') characters. The next N following lines each will be a number (not necessary integer) between 0 and 100, inclusive, denoting each competitor's score in 100-points scaling. Each score has at most two digits precision.

Output

For each test case, print the competition's name at the first line. The next N lines each will contains an integer between 400 and 600 denoting the conversion result. The order of appearance for each competitor should be the same as input.

Sample InputOutput for Sample Input
2
3 BinusProgrammming
20
30
40
7 ICPC-INC
20
30
40
50
60
70
72.56
BinusProgrammming
466.67
500.00
533.33
ICPC-INC
451.78
468.44
485.11
501.77
518.43
535.10
539.36