#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define endl '\n' #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() #define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end()) typedef long long ll; typedef long double ld; typedef pair P; typedef complex comp; typedef vector< vector > matrix; struct pairhash { public: template size_t operator()(const pair &x) const { size_t seed = hash()(x.first); return hash()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2); } }; const int inf = 1e9 + 9; const ll mod = 1e9 + 7; const double eps = 1e-8; const double pi = acos(-1); int n; ld p[3]; ld q[300][3]; ld norm(ld a, ld b, ld c) { return sqrt(a*a+b*b+c*c); } ld dist(int i, int j, int k) { ld r[2][3]; for (int l = 0; l < 3; l++) { r[0][l] = q[j][l] - q[i][l]; r[1][l] = q[k][l] - q[i][l]; } ld c[3]; for (int l = 0; l < 3; l++) { c[l] = r[0][(l+1)%3] * r[1][(l+2)%3] - r[0][(l+2)%3] * r[1][(l+1)%3]; } ld d = 0.0; for (int l = 0; l < 3; l++) { d += c[l] * q[i][l]; } d *= -1; ld res = d; for (int l = 0; l < 3; l++) { res += p[l] * c[l]; } return abs(res) / norm(c[0], c[1], c[2]); } ld solve() { ld res = 0.0; for (int i = 0; i < n; i++) { for (int j = i+1; j < n; j++) { for (int k = j+1; k < n; k++) { res += dist(i, j, k); } } } return res; } void input() { cin >> n; cin >> p[0] >> p[1] >> p[2]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) cin >> q[i][j]; } } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); input(); cout << solve() << endl; }