description: Ezzat has an array of n integers (maybe negative). He wants to split it into two non-empty subsequences a and b, such that every element from the array belongs to exactly one subsequence, and the value of f(a) + f(b) is the maximum possible value, where f(x) is the average of the subsequence x. 
  
  A sequence x is a subsequence of a sequence y if x can be obtained from y by deletion of several (possibly, zero or all) elements.
  
  The average of a subsequence is the sum of the numbers of this subsequence divided by the size of the subsequence.
  
  For example, the average of [1,5,6] is (1+5+6)/3 = 12/3 = 4, so f([1,5,6]) = 4.
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^3)— the number of test cases. Each test case consists of two lines.
  
  The first line contains a single integer n (2 ≤ n ≤ 10^5).
  
  The second line contains n integers a_1, a_2, …, a_n (-10^9 ≤ a_i ≤ 10^9).
  
  It is guaranteed that the sum of n over all test cases does not exceed 3⋅10^5.
  
  Output
  
  For each test case, print a single value — the maximum value that Ezzat can achieve.
  
  Your answer is considered correct if its absolute or relative error does not exceed 10^{-6}.
  
  Formally, let your answer be a, and the jury's answer be b. Your answer is accepted if and only if \frac{|a - b|}{max{(1, |b|)}} ≤ 10^{-6}.
  
  Example
  
  Input
  
  
  4
  3
  3 1 2
  3
  -7 -6 -6
  3
  2 2 2
  4
  17 3 5 -3
  
  
  Output
  
  
  4.500000000
  -12.500000000
  4.000000000
  18.666666667
  
  Note
  
  In the first test case, the array is [3, 1, 2]. These are all the possible ways to split this array: 
  
    * a = [3], b = [1,2], so the value of f(a) + f(b) = 3 + 1.5 = 4.5. 
    * a = [3,1], b = [2], so the value of f(a) + f(b) = 2 + 2 = 4. 
    * a = [3,2], b = [1], so the value of f(a) + f(b) = 2.5 + 1 = 3.5. 
  
  Therefore, the maximum possible value 4.5.
  
  In the second test case, the array is [-7, -6, -6]. These are all the possible ways to split this array: 
  
    * a = [-7], b = [-6,-6], so the value of f(a) + f(b) = (-7) + (-6) = -13. 
    * a = [-7,-6], b = [-6], so the value of f(a) + f(b) = (-6.5) + (-6) = -12.5. 
  
  Therefore, the maximum possible value -12.5.
solution: // "static void main" must be defined in a public class.
  
  //System.out.println();
  // System.out.print();
  
  import java.util.*;
  import java.io.*;
  public class Main {
      
      
      static boolean isPrime(int n)
      {
          // Corner cases
          if (n <= 1) return false;
          if (n <= 3) return true;
           
          // This is checked so that we can skip
          // middle five numbers in below loop
          if (n % 2 == 0 || n % 3 == 0) return false;
           
          for (int i = 5; i * i <= n; i = i + 6)
              if (n % i == 0 || n % (i + 2) == 0)
              return false;
           
          return true;
      }
       
      // Function to return the smallest
      // prime number greater than N
      static int nextPrime(int N)
      {
       
          // Base case
          if (N <= 1)
              return 2;
       
          int prime = N;
          boolean found = false;
           if (isPrime(prime))
                      found = true;
              
          // Loop continuously until isPrime returns
          // true for a number greater than n
          while (!found)
          {
              prime++;
       
              if (isPrime(prime))
                  found = true;
          }
       
          return prime;
      }
      
      
      public static int findXorSum(int arr[], int n)
      {
          // variable to store
          // the final sum
          long sum = 0;
       
          // multiplier
          long mul = 1;
       
          for (int i = 0; i < 30; i++)
          {
       
              // variable to store number of
              // sub-arrays with odd number of elements
              // with ith bits starting from the first
              // element to the end of the array
              long c_odd = 0;
       
              // variable to check the status
              // of the odd-even count while
              // calculating c_odd
              boolean odd = false;
       
              // loop to calculate initial
              // value of c_odd
              for (int j = 0; j < n; j++)
              {
                  if ((arr[j] & (1 << i)) > 0)
                      odd = (!odd);
                  if (odd)
                      c_odd++;
              }
       
              // loop to iterate through
              // all the elements of the
              // array and update sum
              for (int j = 0; j < n; j++)
              {
                  sum += (mul%1000000007 * c_odd%1000000007)%1000000007;
       
                  if ((arr[j] & (1 << i)) > 0)
                      c_odd = (n - j - c_odd);
              }
       
              // updating the multiplier
              mul = (mul%1000000007 * 2)%1000000007;
          }
       
          // returning the sum
          return (int)sum;
      }
      
      
      public static long fact(long n)
      {
          return (n == 1 || n == 0) ? 1 : n * fact(n - 1);
      }
      
      public static long nCr(long n, long r){
          return fact(n) / (fact(r) * fact(n - r));
      }
      
      public static long nPr(long n, long r){
          return fact(n) / fact(n - r);
      }
      
      public static long gcd(long a , long b){
          if(b==0){
              return a;
          }
          return gcd(b,a%b);
      }
      
      public static long lcm(long a, long b){return (a*b)/gcd(a,b);}
      
      public static long fPow(long x, long y, long p){
          long res = 1; // Initialize result
  
          x = x % p; // Update x if it is more than or
          // equal to p
  
          if (x == 0)
            return 0; // In case x is divisible by p;
  
          while (y > 0)
          {
  
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
              res = (res * x) % p;
  
            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
          }
          return res;
      }
      
      public static int binS(int[] sortedArray, int key, int low, int high) {
      int index = Integer.MAX_VALUE;
      
      while (low <= high) {
          int mid = low  + ((high - low) / 2);
          if (sortedArray[mid] < key) {
              low = mid + 1;
          } else if (sortedArray[mid] >= key) {
              high = mid - 1;
          }
          // else if (sortedArray[mid] == key) {
          //     low = mid;
          //     break;
          // }
      }
      return low;
  }
      
      public static int binS1(int[] sortedArray, int key, int low, int high) {
      int index = Integer.MAX_VALUE;
      
      while (low <= high) {
          int mid = low  + ((high - low) / 2);
          if (sortedArray[mid] <= key) {
              low = mid + 1;
          } else if (sortedArray[mid] > key) {
              high = mid - 1;
          }
          // else if (sortedArray[mid] == key) {
          //     low = mid;
          //     break;
          // }
      }
      return high;
  }
          
      public static void main(String[] args) throws IOException {
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          
          int t = Integer.parseInt(br.readLine());
          for(int q=0;q<t;q++){
              int n = Integer.parseInt(br.readLine());
              // String s[] = br.readLine().split(" ");
              // int n = Integer.parseInt(s[0]);
              // int x = Integer.parseInt(s[1]);
              // // int k = Integer.parseInt(s[2]);
              String s1[] = br.readLine().split(" ");
              int a[] = new int[n];
              for(int i=0;i<n;i++){
                  a[i] = Integer.parseInt(s1[i]);
              }
              Arrays.sort(a);
              double max=Integer.MIN_VALUE;
              int t1=0;
              int t2=n;
              long tmp1=0;
              long tmp2=0;
              for(int i=0;i<n;i++){
                  tmp2+=a[i];
              }
              for(int i=0;i<n;i++){
                  tmp1 += a[i];
                  t1++;
                  tmp2 -= a[i];
                  t2--;
                  if(max< (double)tmp1/t1 + (double)tmp2/t2){
                      max = (double)tmp1/t1 + (double)tmp2/t2;
                  }
              }
              System.out.println(String.format("%.9f",max));
          }        
      }  
  }
  