#ifndef _GLIBCXX_NO_ASSERT #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#ifdef __GXX_EXPERIMENTAL_CXX0X__ #include #include #include #include #include #include #include #include //#endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include //#include #include //#include #include //#include #include #include #include #include //#include #include #include #include #include #include using namespace std; typedef struct D3 { double x; double y; double z; }; int main () { D3 P; int N; cin >> N; cin >> P.x >> P.y >> P.z; vectorQ ( N ); for( size_t i = 0; i < N; i++ ) { cin >> Q[i].x >> Q[i].y >> Q[i].z; } double ans = 0.0; for( size_t i = 0; i < N; i++ ) { for( size_t j = i + 1; j < N; j++ ) { for( size_t k = j + 1; k < N; k++ ) { D3 a; a.x = Q[j].x - Q[i].x; a.y = Q[j].y - Q[i].y; a.z = Q[j].z - Q[i].z; D3 b; b.x = Q[j].x - Q[k].x; b.y = Q[j].y - Q[k].y; b.z = Q[j].z - Q[k].z; D3 G; G.x = a.y*b.z - a.z*b.y; G.y = a.z*b.x - a.x*b.z; G.z = a.x*b.y - a.y*b.x; double S; S = sqrt ( G.x*G.x + G.y*G.y + G.z*G.z ) / 2; D3 c; c.x = Q[j].x - P.x; c.y = Q[j].y - P.y; c.z = Q[j].z - P.z; double V; V = ( G.x*c.x + G.y*c.y + G.z*c.z ) / 6; ans += abs ( V *3.0 / S ); } } } cout << fixed << setprecision ( 12 ) << ans << endl; return 0; }