#include<cstdio> #include<cmath> #include<algorithm> usingnamespace std; constint N = 20; constdouble eps = 1e-8; int n; double p[N][N], A[N][N]; intGauss() { int c = 0, r = 0; for (; c < n; c++) { int t = r; for (int i = r; i < n; i++) if (fabs(A[i][c]) > fabs(A[t][c])) t = i; if (fabs(A[t][c]) < eps) continue; for (int i = c; i <= n; i++) swap(A[t][i], A[r][i]); for (int i = n; i >= c; i--) A[r][i] /= A[r][c]; for (int i = r + 1; i < n; i++) if (fabs(A[i][c]) > eps) for (int j = n; j >= c; j--) A[i][j] -= A[r][j] * A[i][c]; r++; } if (r < n) { for (int i = r; i < n; i++) if (fabs(A[i][n]) > eps) return1; return2; } for (int i = n - 1; i >= 0; i--) for (int j = i + 1; j < n; ++j) A[i][n] -= A[i][j] * A[j][n]; return0; } intmain() { scanf("%d", &n); for (int i = 0; i <= n; i++) for (int j = 0; j < n; j++) scanf("%lf", &p[i][j]); for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) { A[i][j] = 2 * (p[i][j] - p[i + 1][j]); A[i][n] += p[i][j] * p[i][j] - p[i + 1][j] * p[i + 1][j]; } Gauss(); for (int i = 0; i < n; i++) printf("%.3lf ", A[i][n]); return0; }