import std; void scan(T...)(ref T a) { string[] ss = readln.split; foreach (i, t; T) a[i] = ss[i].to!t; } T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int; double calc(Vec3 p, Vec3[] vs) { double sum = 0; for (int i = 0; i < vs.length; i++) { for (int j = i + 1; j < vs.length; j++) { for (int k = j + 1; k < vs.length; k++) { auto ab = vs[j] - vs[i]; auto ac = vs[k] - vs[i]; auto v = ab.cross(ac).normalized(); auto ap = p - vs[i]; sum += abs(ap.dot(v)); } } } return sum; } void main() { int n = readint; double px, py, pz; scan(px, py, pz); auto p = Vec3(px, py, pz); Vec3[] vs; for (int i = 0; i < n; i++) { double x, y, z; scan(x, y, z); vs ~= Vec3(x, y, z); } auto ans = calc(p, vs); writefln("%.8f", ans); } struct Vec3 { immutable double x; immutable double y; immutable double z; this(double x, double y, double z) { this.x = x; this.y = y; this.z = z; } double dot(Vec3 o) { return this.x * o.x + this.y * o.y + this.z * o.z; } Vec3 cross(Vec3 o) { auto x = this.y * o.z - o.y * this.z; auto y = this.z * o.x - o.z * this.x; auto z = this.x * o.y - o.x * this.y; return Vec3(x, y, z); } double mag() { return sqrt(magSq()); } double magSq() { return this.x * this.x + this.y * this.y + this.z * this.z; } Vec3 normalized() { auto m = mag(); return Vec3(this.x / m, this.y / m, this.z / m); } Vec3 opUnary(string op)() if (op == "-") { return Vec3(-this.x, -this.y, -this.z); } Vec3 opBinary(string op)(Vec3 o) if (op == "+") { return Vec3(this.x + o.x, this.y + o.y, this.z + o.z); } Vec3 opBinary(string op)(Vec3 o) if (op == "-") { return Vec3(this.x - o.x, this.y - o.y, this.z - o.z); } Vec3 opBinary(string op)(double d) if (op == "*") { return Vec3(this.x * d, this.y * d, this.z * d); } Vec3 opBinaryRight(string op)(double d) if (op == "*") { return Vec3(this.x * d, this.y * d, this.z * d); } }