Language: C

#include<iostream>
#include<cmath>
#include<complex>
#include<iomanip>
#include<cassert>

using namespace std;

typedef complex<double> point;
typedef pair<point,point> line;


bool makeable(int a, int b, int c){
  return a+b>c && b+c>a && c+a>b;
}

inline double my_pow(double a, double b){
  return pow(a, b);
}

double vofh(int a, int b, int c, int p, int q, int r)
{
  double s = -2.0 * my_pow(a, 2) * my_pow(b, 2) * my_pow(p, 2)+2 * my_pow(a, 2) * my_pow(c, 2) * my_pow(p, 2)+2 * my_pow(b, 2) * my_pow(c, 2) * my_pow(p, 2)-2 * my_pow(c, 4) * my_pow(p, 2)-2 * my_pow(c, 2) * my_pow(p, 4)+2 * my_pow(a, 2) * my_pow(b, 2) * my_pow(q, 2)-2 * my_pow(b, 4) * my_pow(q, 2)-2 * my_pow(a, 2) * my_pow(c, 2) * my_pow(q, 2)+2 * my_pow(b, 2) * my_pow(c, 2) * my_pow(q, 2)+2 * my_pow(b, 2) * my_pow(p, 2) * my_pow(q, 2)+2 * my_pow(c, 2) * my_pow(p, 2) * my_pow(q, 2)-2 * my_pow(b, 2) * my_pow(q, 4)-2 * my_pow(a, 4) * my_pow(r, 2)+2 * my_pow(a, 2) * my_pow(b, 2) * my_pow(r, 2)+2 * my_pow(a, 2) * my_pow(c, 2) * my_pow(r, 2)-2 * my_pow(b, 2) * my_pow(c, 2) * my_pow(r, 2)+2 * my_pow(a, 2) * my_pow(p, 2) * my_pow(r, 2)+2 * my_pow(c, 2) * my_pow(p, 2) * my_pow(r, 2)+2 * my_pow(a, 2) * my_pow(q, 2) * my_pow(r, 2)+2 * my_pow(b, 2) * my_pow(q, 2) * my_pow(r, 2)-2 * my_pow(p, 2) * my_pow(q, 2) * my_pow(r, 2)-2 * my_pow(a, 2) * my_pow(r, 4);
  return sqrt(s / 288);
}

const double pi = 2*acos(0.0);

int main()
{
  int N;
  while(cin>>N)
  {
    double res = 0;
    if( N == 0 ) break;
    int a[N];

    for(int i = 0; i < N; ++i){
      cin >> a[i];
    }

    int comb = (1<<3) - 1;
    while(comb<(1<<N)){      
      int cnt = 0;
      int e[3];
      bool used[N];
      for(int b = 0; b < N; ++b){
        if( comb & (1<<b) ){
          // cout << 1;
          e[cnt++] = a[b];
          used[b] = true;
        }else{
          // cout << 0;
          used[b] = false;
        }
      }
      // cout << endl;
      assert(cnt==3);
      
      if( makeable( e[0], e[1], e[2] ) ){
        for(int i = 0; i < N; ++i){
          for(int j = i+1; j < N; ++j){
            if( !used[i] && !used[j] ){
              
              for(int k = 0; k < 3; ++k){
                int f0 = e[k];
                int f1 = e[(k+1)%3];
                int f2 = e[(k+2)%3];
                
                if( makeable(a[i], a[j], f0) ){
                  double f = f1;
                  double h = a[i];
                  
                  for(int l = 0; l < N; ++l){
                    if( l != i && l != j && !used[l] ){
                      int x = a[l];
                      double tcos = (x*x - f*f - h*h)/(2.*f*h);
                      double tsin = 1-tcos*tcos;
                      if( makeable(x,f1,a[i]) && tsin > 0 ){
                        res = max(res , vofh(a[i],a[j],a[l],f0,f1,f2));
                      }
                    }
                  }
                }
                

              }

            }
          }
        }
      }

      int x = comb & -comb;
      int y = comb + x;
      comb = ((comb & ~y) / x >> 1 ) | y;      
    }

    cout << fixed << setprecision(11) << res << endl;

    
  }
  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.