package no132; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Vector3 p = new Vector3(sc.nextDouble(), sc.nextDouble(), sc.nextDouble()); Vector3[] x = new Vector3[n]; for(int i=0;i<n;i++) { x[i] = new Vector3(sc.nextDouble(), sc.nextDouble(), sc.nextDouble()); } double ans = 0; for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { for(int k=j+1;k<n;k++) { Vector3 v1 = x[j].subtract(x[i]); Vector3 v2 = x[k].subtract(x[i]); Vector3 r = p.subtract(x[i]); Vector3 t = v1.cross(v2).normalize(); ans += Math.abs(r.dot(t)); } } } System.out.println(ans); } } class Vector3 { public static final Vector3 ZERO = new Vector3(0, 0, 0); public double x; public double y; public double z; public Vector3(double x,double y,double z) { this.x = x; this.y = y; this.z = z; } public double dot(Vector3 v) { return x * v.x + y * v.y + z * v.z; } public Vector3 cross(Vector3 v) { return new Vector3(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x); } public Vector3 add(Vector3 v) { return new Vector3(x + v.x, y + v.y, z + v.z); } public Vector3 subtract(Vector3 v) { return new Vector3(x - v.x, y - v.y, z - v.z); } public Vector3 multiply(double k) { return new Vector3(k * x, k * y, k * z); } public double normSq() { return x * x + y * y + z * z; } public double norm() { return Math.sqrt(normSq()); } public Vector3 normalize() { return multiply(1 / norm()); } public boolean isZero() { return x == 0 && y == 0 && z == 0; } public boolean equals(Object o) { if (o instanceof Vector3) { Vector3 v = (Vector3) o; return x == v.x && y == v.y && z == v.z; } return super.equals(o); } public String toString() { return "[" + this.x + "," + this.y + "," + this.z + "]"; } }