#include using namespace std; long double x[301], y[301], z[301]; long double px,py,pz; int n; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; cin >> px >> py >> pz; for (int i = 1; i <= n; i++) { cin >> x[i] >> y[i] >> z[i]; } long double res = 0; for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { for (int k = j + 1; k <= n; k++) { long double a[3], b[3]; a[0] = x[j] - x[i]; a[1] = y[j] - y[i]; a[2] = z[j] - z[i]; b[0] = x[k] - x[i]; b[1] = y[k] - y[i]; b[2] = z[k] - z[i]; long double A = (a[1] * b[2] - a[2] * b[1]); long double B = -(a[0] * b[2] - a[2] * b[0]); long double C = (a[0] * b[1] - a[1] * b[0]); long double D = (A * x[i] + B * y[i] + C * z[i]); long double dist = abs(A * px + B * py + C * pz - D); dist /= sqrt(A * A + B * B + C * C); res += dist; } } } cout << fixed; cout.precision(18); cout << res << '\n'; return 0; }