Safety in Numbers

Compute for each contestant the smallest vote percentage that guarantees another contestant ties or trails them no matter how the remaining votes split.

Medium5MathBinary searchSortingNo attempts yetTime limit5sMemory limit512 MB

Problem

A reality TV show has NN contestants. Each contestant gets a score from the judges, and the audience vote is added on top of it to form a final score.

Let XX be the sum of the judge scores of all contestants. If a contestant received JJ points from the judges and a fraction YY of the audience vote, where 0Y10 \le Y \le 1 (for example 0.30.3), then that contestant's final score is J+XYJ + X \cdot Y. The vote fractions of all contestants add up to exactly 11.

The contestant with the lowest final score is eliminated. If two or more contestants share the lowest score, nobody is eliminated.

Once contestant ii's vote fraction is fixed at YY, the remaining fraction 1Y1 - Y can be split among the other contestants in any way, with a nonnegative amount for each of them. Given the judge scores, find for every contestant the smallest YY, as a percentage, that keeps that contestant out of elimination no matter how the remaining votes are split.

Input

The first line contains the number of test cases TT. Each of the next TT lines holds one test case. A line starts with the number of contestants NN, then a single space, then the judge scores s0,s1,,sN1s_0, s_1, \dots, s_{N-1} separated by single spaces. The value sis_i is the score contestant ii received from the judges.

Limits

  • 1T501 \le T \le 50
  • 2N2002 \le N \le 200
  • 0si1000 \le s_i \le 100
  • si>0s_i > 0 for at least one ii.

Output

Print one line per test case. The line starts with Case #x: , then the real numbers m0,m1,,mN1m_0, m_1, \dots, m_{N-1} separated by single spaces. Here xx is the test case number starting from 11, and mim_i is the smallest percentage of the audience vote contestant ii must secure to be certain of avoiding elimination.

Always print mim_i with exactly six digits after the decimal point. Round the exact value at the seventh digit after the decimal point, rounding up when that digit is exactly 55. A value of 00 prints as 0.000000 and a value of 100100 prints as 100.000000.