Language: C

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
#define eps 1e-8
#define fabs(x) ((x) > 0?(x):-(x))
#define zero(x) (fabs(x) < eps)
#define sqr(x) ((x)*(x))
struct point3{
	double x, y, z;
	void read(){
		scanf("%lf %lf %lf", &x, &y, &z);
	};
	point3 operator - (const point3 &b)const{
		point3 a;
		a.x = x - b.x;
		a.y = y - b.y;
		a.z = z - b.z;
	};
	friend ostream & operator << (ostream &out, const point3 &a){
		out<<a.x<<' '<<a.y<<' '<<a.z;
		return out;
	};
};
struct plane3{
	point3 a, b, c;
	friend ostream &operator << (ostream & out, const plane3 &x){
		out<<x.a<<' '<<x.b<<' '<<x.c;
		return out;
	}
};

point3 xmult(const point3 &u, const point3 &v){
	point3 ret;
	ret.x = u.y * v.z - v.y * u.z;
	ret.y = u.z * v.x - u.x * v.z;
	ret.z = u.x * v.y - u.y * v.x;
	return ret;
};
double dmult(const point3 & u, const point3 &v){
	return u.x * v.x + u.y * v.y + u.z * v.z;
};
point3 pvec(const point3 & s1, const point3 &s2, const point3 &s3){
	return xmult(s1 - s2, s2 - s3);
};
double dis(const point3 &p1, const point3 &p2){
	return sqrt(sqr(p1.x - p2.x) + sqr(p1.y - p2.y) + sqr(p1.z - p2.z));
};
double len(const point3 &p){
	return sqrt(sqr(p.x) + sqr(p.y) + sqr(p.z));
};

point3 pvec(const plane3 &s){
	return xmult(s.a - s.b, s.b - s.c);
};
int dots_onplane(const point3 &a, const point3 &b, const point3 &c, const point3 &d){
	return zero(dmult(pvec(a, b, c), d - a));

};
double ptoplane(const point3 &p, const plane3 & s){
	return fabs(dmult(pvec(s), p - s.a)) / len(pvec(s));
};
double area_triangle(const plane3 &p){
	return len(xmult(p.b - p.a, p.c - p.a)) / 2;
};
const int MAXN = 50;
const int MAXM = 5000;

struct NODE{
	int p[4], next, out;
	point3 f;
}s[MAXM];
point3 p[MAXM];
plane3 convex[MAXM];
int edge[MAXN][MAXN];
int tot;
int next(int x){
	//cout<<x<<endl;
	if (s[x].next == x) return x;
	return s[x].next = next(s[x].next);
};
void add(int a, int b, int c, point3 *p){
	s[tot].p[0] = a;
	s[tot].p[1] = b;
	s[tot].p[2] = c;
	s[tot].p[3] = a;
	s[tot].f = xmult(p[b] - p[a], p[c] - p[a]);
	s[tot].out = false;
	for (int i = 0; i < 3; ++i)
		edge[s[tot].p[i]][s[tot].p[i + 1]] = tot;
	++tot;
}
void add(int a, int b, int c, int d, point3 *p){
	point3 f = xmult(p[b] - p[a], p[c] - p[a]);
	if (dmult(f, p[d] - p[a]) > 0) add(a, c, b, p);
	else add(a, b, c, p);
};
int get_convex(int n, point3 * p, plane3 * convex){
	for (int i = 0; i < MAXM; ++i)
		s[i].next = i;
	tot = 0;
	for (int i = 3; i < n; ++i)
		if (!dots_onplane(p[0], p[1], p[2], p[i])){
			swap(p[i], p[3]);
			break;
		}
	//cout<<"hehe"<<endl;
	add(0, 1, 2, 3, p);
	add(2, 3, 0, 1, p);
	add(3, 1, 0, 2, p);
	add(3, 1, 2, 0 ,p);
	for (int i = 4; i < n; ++i){
		cout<<i<<endl;
		for (int j = next(0); j < tot; j = next(j + 1)){
			cout<<j<<' '<<tot<<endl;
			s[j].out = dmult(s[j].f, p[i] - p[s[j].p[0]]) > 0;
		}
		cout<<i<<endl;
		int c = tot;
		for (int j = next(0); j < tot; j = next(j + 1))
				if (s[j].out){
					for (int k = 0; k < 3; ++k)
						if (!s[edge[s[j].p[k + 1]][s[j].p[k]]].out)
							add(s[j].p[k], s[j].p[k + 1], i, p);
					s[j].next = j + 1;
				}
	}
	int i, j;
	for (i = 0, j < next(0); j < tot; ++i, j = next(j + 1)){
		convex[i].a = p[s[j].p[0]];
		convex[i].b = p[s[j].p[1]];
		convex[i].c = p[s[j].p[2]];
	}
	return i;
}

int main(){
	int n;
	while (true){
		scanf("%d", &n);
		if (!n) break;
		cout<<n<<endl;
		for (int i = 0; i < n; ++i)
			p[i].read();
		cout<<"hehe"<<endl;
		int m = get_convex(n, p, convex);
		for (int i = 0; i < m; ++i)
			cout<<convex[i]<<endl;
		cout<<m<<endl;
		double ansh = 0;
		double anss = 0;
		for (int i = 0; i < m; ++i){
			double h = 0;
			double s = 0;
			for (int j = 0; j < n; ++j)
				h = max(h, ptoplane(p[j], convex[i]));
			cout<<h<<endl;
			if (h + eps < ansh) continue;
			if (ansh + eps < h) anss = 0;
			ansh = h;
			for (int j = 0; j < m; ++j){
				if (!dots_onplane(convex[i].a, convex[i].b, convex[i].c, convex[j].a)) continue;
				if (!dots_onplane(convex[i].a, convex[i].b, convex[i].c, convex[j].b)) continue;
				if (!dots_onplane(convex[i].a, convex[i].b, convex[i].c, convex[j].c)) continue;
				s += abs(area_triangle(convex[j]));
			}
			anss = max(anss, s);
		}
		printf("%.3lf %.3lf\n", ansh, anss);
	}
}

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