#include using namespace std; typedef long long int ll; typedef pair pii; typedef vector vi; typedef vector > vii; #define rrep(i, m, n) for(int (i)=(m); (i)<(n); (i)++) #define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++) #define rep(i, n) for(int (i)=0; (i)<(n); (i)++) #define rev(i, n) for(int (i)=(n)-1; (i)>=0; (i)--) #define vrep(i, c) for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++) #define ALL(v) (v).begin(), (v).end() #define mp make_pair #define pb push_back template inline void minup(T1& m, T2 x){ if(m>x) m=static_cast(x); } template inline void maxup(T1& m, T2 x){ if(m(x); } #define INF 1000000000 #define MOD 1000000007 #define EPS 1E-12 const int MAX_N = 300; double P[3]; double Q[MAX_N][3]; int n; double res; // 幾何ライブラリを作りたい..... int main() { cin >> n; cin >> P[0] >> P[1] >> P[2]; rep(i, n) rep(j, 3) cin >> Q[i][j]; rep(i, n) rep(j, 3) Q[i][j] -= P[j]; rep(i, n) rep(j, i) rep(k, j){ double Px = Q[j][0] - Q[i][0]; double Py = Q[j][1] - Q[i][1]; double Pz = Q[j][2] - Q[i][2]; double Qx = Q[k][0] - Q[i][0]; double Qy = Q[k][1] - Q[i][1]; double Qz = Q[k][2] - Q[i][2]; double dx = Py * Qz - Pz * Qy; double dy = Pz * Qx - Px * Qz; double dz = Px * Qy - Py * Qx; res += abs(Q[i][0]*dx + Q[i][1]*dy + Q[i][2]*dz) / sqrt(dx*dx + dy*dy + dz*dz); } printf("%.10f\n", res); return 0; }