import scala.io.StdIn class Vector3(_x: Double, _y: Double, _z: Double) { val (x, y, z) = (_x, _y, _z) def this() = this(0, 0, 0) def this(a: Array[Double]) = this(a(0), a(1), a(2)) def -(o: Vector3): Vector3 = new Vector3(x - o.x, y - o.y, z - o.z) def cross_product(o: Vector3): Vector3 = new Vector3(y * o.z - z * o.y, z * o.x - x * o.z, x * o.y - y * o.x) def inner_product(o: Vector3): Double = x * o.x + y * o.y + z * o.z def norm(): Double = scala.math.sqrt(x * x + y * y + z * z) } object Main extends App { val n: Int = StdIn.readInt() val p: Vector3 = new Vector3(StdIn.readLine().split(" ").map(_.toDouble)) val l = (1 to n).map(_ => new Vector3(StdIn.readLine().split(" ").map(_.toDouble)) - p) val ans = l.combinations(3).map { a => val t = (a(1) - a(0)).cross_product(a(2) - a(0)) scala.math.abs(a(0).inner_product(t)) / t.norm }.sum println(ans) }