Problem: Peter P. Pepper is facing a difficulty.

After fierce battles with the Principality of Croode, the Aaronbarc Kingdom, for which he serves, had the last laugh in the end. Peter had done great service in the war, and the king decided to give him a big reward. But alas, the mean king gave him a hard question to try his intelligence. Peter is given a number of sticks, and he is requested to form a tetrahedral vessel with these sticks. Then he will be, said the king, given as much patas (currency in this kingdom) as the volume of the vessel. In the situation, he has only to form a frame of a vessel.

<image>

Figure 1: An example tetrahedron vessel

The king posed two rules to him in forming a vessel: (1) he need not use all of the given sticks, and (2) he must not glue two or more sticks together in order to make a longer stick.

Needless to say, he wants to obtain as much patas as possible. Thus he wants to know the maximum patas he can be given. So he called you, a friend of him, and asked to write a program to solve the problem.



Input

The input consists of multiple test cases. Each test case is given in a line in the format below:


N a1 a2 . . . aN


where N indicates the number of sticks Peter is given, and ai indicates the length (in centimeters) of each stick. You may assume 6 ≤ N ≤ 15 and 1 ≤ ai ≤ 100.

The input terminates with the line containing a single zero.

Output

For each test case, print the maximum possible volume (in cubic centimeters) of a tetrahedral vessel which can be formed with the given sticks. You may print an arbitrary number of digits after the decimal point, provided that the printed value does not contain an error greater than 10-6.

It is guaranteed that for each test case, at least one tetrahedral vessel can be formed.

Example

Input

7 1 2 2 2 2 2 2
0


Output

0.942809

Solution (in CPP):

Solution:
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <complex>
#include <cstdio>
using namespace std;

double EPS = 1e-8;
typedef complex<double> P,point;

struct C {P p; double r; C(const P &p,double r) : p(p), r(r){} C(){} };


typedef double number;
const number eps = 1e-8;
typedef vector<number> Array;
typedef vector<Array> matrix;

// O( n )
matrix identity(int n) {
  matrix A(n, Array(n));
  for (int i = 0; i < n; ++i) A[i][i] = 1;
  return A;
}
// O( n )
number inner_product(const Array &a, const Array &b) {
  number ans = 0;
  for (int i = 0; i < a.size(); ++i)
    ans += a[i] * b[i];
  return ans;
}
// O( n^2 )
Array mul(const matrix &A, const Array &x) {
  Array y(A.size());
  for (int i = 0; i < A.size(); ++i)
    for (int j = 0; j < A[0].size(); ++j)
      y[i] = A[i][j] * x[j];
  return y;
}
// O( n^3 )
matrix mul(const matrix &A, const matrix &B) {
  matrix C(A.size(), Array(B[0].size()));
  for (int i = 0; i < C.size(); ++i)
    for (int j = 0; j < C[i].size(); ++j)
      for (int k = 0; k < A[i].size(); ++k)
        C[i][j] += A[i][k] * B[k][j];
  return C;
}
// O( n^3 log e )
matrix pow(const matrix &A, int e) {
  return e == 0 ? identity(A.size())  :
     e % 2 == 0 ? pow(mul(A, A), e/2) : mul(A, pow(A, e-1));
}
// O( n^3 )
number det(matrix A) {
  const int n = A.size();
  number D = 1;
  for (int i = 0; i < n; ++i) {
    int pivot = i;
    for (int j = i+1; j < n; ++j)
      if (abs(A[j][i]) > abs(A[pivot][i])) pivot = j;
    swap(A[pivot], A[i]);
    D *= A[i][i] * (i != pivot ? -1 : 1);
    if (abs(A[i][i]) < eps) break;
    for(int j = i+1; j < n; ++j)
      for(int k = n-1; k >= i; --k)
        A[j][k] -= A[i][k] * A[j][i] / A[i][i];
  }
  return D;
}
// O(n)
number tr(const matrix &A) {
  number ans = 0;
  for (int i = 0; i < A.size(); ++i)
    ans += A[i][i];
  return ans;
}
// O( n^3 ).
int rank(matrix A) {
  const int n = A.size(), m = A[0].size();
  int r = 0;
  for (int i = 0; r < n && i < m; ++i) {
    int pivot = r;
    for (int j = r+1; j < n; ++j)
      if (abs(A[j][i]) > abs(A[pivot][i])) pivot = j;
    swap(A[pivot], A[r]);
    if (abs(A[r][i]) < eps) continue;
    for (int k = m-1; k >= i; --k)
      A[r][k] /= A[r][i];
    for(int j = r+1; j < n; ++j)
      for(int k = i; k < m; ++k)
        A[j][k] -= A[r][k] * A[j][i];
    ++r;
  }
  return r;
}

double chk(double a,double b,double c){
	if( a > b ) swap(a,b);
	if( b > c ) swap(b,c);
	if( a > b ) swap(a,b);
	return a + b >= c;
}
double calc(double a,double b,double c,double d,double e,double f){
	double x = a*a*d*d*(b*b+c*c+e*e+f*f-a*a-d*d)+b*b*e*e*(c*c+a*a+f*f+d*d-b*b-e*e)+c*c*f*f*(a*a+b*b+d*d+e*e-c*c-f*f)-a*a*b*b*c*c-a*a*e*e*f*f-d*d*b*b*f*f-d*d*e*e*c*c;
	return x>0?sqrt(x / 144):0;
}
int main(){
	int N;
	while(cin >> N && N){
		vector<int> t(N);
		double ans = 0;
		vector<int> reflesh(6,0);
		
		int cnt = 0;
		//cout << calc(P(0,0),P(0,1),P(1,1),1,1,1) << endl;
		for(int i = 0 ; i < N ; i++) cin >> t[i];
		sort(t.begin(),t.end());
		for(int i = 0 ; i < (1<<N) ; i++){
			if( __builtin_popcount(i) == 6 ){
				vector<int> v;
				for(int j = 0 ; j < N ; j++) if(i>>j&1)v.push_back(t[j]);
				do{
					double a,b,c,d,e,f;
					tie(a,b,c,d,e,f) = tuple<double,double,double,double,double,double>{v[0],v[1],v[2],v[3],v[4],v[5]};
					if( chk(a,e,f) && chk(a,b,c) && chk(e,d,c) && chk(d,b,f) ){
						ans = max(ans,calc(v[0],v[1],v[2],v[3],v[4],v[5]));
					}
				}while( next_permutation(v.begin(),v.end()) );
			}
		}
		//cout << cnt << endl;
		if(ans == 0){
			for(int i = 0 ; i < N ; i++) cout << t[i] << " "; cout << endl;
		}
		printf("%.10lf%c",ans,10);
	}
}