#include #include #include #include #define FORR(i,b,e) for(int i=(b);i<(int)(e);++i) #define FOR(i,e) FORR(i,0,e) #define dump(var) cerr << #var ": " << var << "\n" #define dumpc(con) for(auto& e: con) cerr << e << " "; cerr<<"\n" typedef long long ll; typedef unsigned long long ull; using namespace std; struct Vector3D { double x, y, z; Vector3D(){} Vector3D(double x, double y, double z): x(x), y(y), z(z) {} Vector3D(const Vector3D &v) { x = v.x; y = v.y; z = v.z; } Vector3D operator+(const Vector3D &v) const { return Vector3D(x+v.x, y+v.y, z+v.z); } Vector3D operator-(const Vector3D &v) const { return Vector3D(x-v.x, y-v.y, z-v.z); } double length() { return sqrt(x*x+y*y+z*z); } void normalize() { double l = length(); x/=l; y/=l; z/=l; } double dot(const Vector3D &v) { return x*v.x + y*v.y + z*v.z; } Vector3D cross(const Vector3D &v) { return Vector3D(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x); } }; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; Vector3D p; vector v(N); cin >> p.x >> p.y >> p.z; FOR(i, N) cin >> v[i].x >> v[i].y >> v[i].z; Vector3D vp, v1, v2, normal; double length = 0; v1 = v[1] - v[0]; FOR(i, N) FOR(j, i) { vp = v[i] - p; v1 = v[j] - v[i]; FOR(k, j) { v2 = v[k] - v[j]; normal = v1.cross(v2); normal.normalize(); length += abs(vp.dot(normal)); } } cout << fixed << setprecision(10); cout << length << endl; return 0; }