Limits 500ms, 512 MB

You all know the famous scientist professor Shonku. He needs your earnest help to analyze the result for one his recent experiments.

Professor Shonku is experimenting on some top secret research topic. The result of his experiment is a set of positive integer data. He wants to know whether this data has some outliers or not. The simple process for identifying outliers is presented below:

First, you need to sort the data in ascending order and get the middle value (median) M. For odd number of data you will get one median. For even number of data you will get two median, you have to take their average as median. See the explanation for better understanding.This median divides the data into two groups. You can consider the data left of M as Group1 and data right of M as Group2. Then, you calculate median value for Group1 and Group2. Let, Q1 is the median value of Group1 and Q2 is the median value for Group2.

The value of IQR is calculated in the following equation: IQR = Q2 - Q1. Then calculate the following two values: F1 = Q1 - 1.5 * IQR and F2 = Q2 + 1.5 * IQR. Any value outside the range between F1 and F2 is considered to be an outlier.

Please, help him to calculate the total number of unique outliers in his result data.

Input

First line of input will contain E, the total number of experiments. 1<=E<=200. Each of the next E line starts with a number N (5 <= N <= 10^5). Then there will be N space separated positive integers that represents the result data R (1<=R<= 10^6) for that particular experiment.

Output

For each experiment, print the single line “Experiment P: W X Y Z”. Here, P = experiment number, W = M, X = Q1, Y = Q2 and Z = total number of unique outliers. You should print two decimal point for W, X and Y.

Sample

InputOutput
3
6 1 2 3 4 5 6 
15 3 13 7 5 21 23 39 23 40 23 14 12 56 23 29
14 3 5 7 12 13 14 21 23 23 23 23 29 40 56
Experiment 1: 3.50 2.00 5.00 0
Experiment 2: 23.00 12.00 29.00 1
Experiment 3: 22.00 12.00 23.00 2

If you consider the first sample test case, the data is already sorted. The median value is 3.50 (the average of 3 and 4). You will get two groups. Group1: 1,2,3 and Group2: 4,5,6. Therefore, Q1 = 2 (middle value of Group1) and Q2 = 5 (middle value of Group2). IQR = 5-2 = 3. F1 = -2.5 and F2 = 9.5. Since there is no value outside the range -2.5 to 9.5, there is no outlier in the experiment.

The value of N could be large enough to 10^5.

Submit

Login to submit.

Statistics

67% Solution Ratio
BRUR_DivByZeroEarliest, Jan '18
nusuBotFastest, 0.0s
BRUR_DivByZeroLightest, 524 kB
ankonashShortest, 1473B
Toph uses cookies. By continuing you agree to our Cookie Policy.