#include "bits/stdc++.h" using namespace std; #define int long long #define FOR(i, a, b) for(int i=(a);i<(b);i++) #define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--) #define REP(i, n) for(int i=0; i<(n); i++) #define RREP(i, n) for(int i=(n-1); i>=0; i--) #define ALL(a) (a).begin(),(a).end() #define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end()); #define CONTAIN(a, b) find(ALL(a), (b)) != (a).end() #define array2(type, x, y) array, x> #define vector2(type) vector > #define out(...) printf(__VA_ARGS__) int dxy[] = {0, 1, 0, -1, 0}; /*================================*/ int N,M,L; template struct Pos { T x, y, z; Pos(){}; Pos(T _x, T _y): x(_x), y(_y){}; Pos(T _x, T _y, T _z): x(_x), y(_y), z(_z){}; Pos operator * (T t) { return Pos(t * x, t * y); } Pos operator + (Pos q) { return Pos(x + q.x, y + q.y, z + q.z); } Pos operator - (Pos q) { return Pos(x - q.x, y - q.y, z - q.z); } int dot(Pos q) { return x * q.x + y * q.y; } int det(Pos q) { return x * q.y - y * q.x; } bool operator == (Pos q) { return (x == q.x) && (y == q.y); } Pos operator * ( const Pos& q ) { return Pos( y*q.z - z*q.y , z*q.x - x*q.z , x*q.y - y*q.x ); } double operator % ( const Pos& q ) { return ( x*q.x + y*q.y + z*q.z ); } double norm() { return sqrt(x*x + y*y + z*z); } }; typedef Pos pos; pos p; vector X(444); double dist(int i, int j, int k) { pos a = X[i], b = X[j], c = X[k]; pos pa =a-p, pb=b-p, pc=c-p; double v = (pa.y*pb.z*pc.x + pa.z*pb.x*pc.y + pa.x*pb.y*pc.z - pa.z*pb.y*pc.x - pa.x*pb.z*pc.y - pa.y*pb.x*pc.z)/6; double s = ((b-a)*(c-a)).norm()/2; return abs(3*v/s); } signed main() { #if DEBUG std::ifstream in("input.txt"); std::cin.rdbuf(in.rdbuf()); #endif cin>>N; cin>>p.x>>p.y>>p.z; REP(i,N)cin>>X[i].x>>X[i].y>>X[i].z; double ans = 0; FOR(i,0,N-2) FOR(j,i+1,N-1) FOR(k,j+1,N) { ans += dist(i,j,k); } out("%.14f\n", ans); return 0; }