/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
static double p[][];
static double dp[];
static int n;
public static double f(int mask) {
if (dp[mask] > -0.5)
return dp[mask];
return dp[mask];
}
n
= Integer.
parseInt(bf.
readLine()); p = new double[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
p
[i
][j
] = Double.
parseDouble(st.
nextToken()); }
}
dp = new double[1 << n];
int limit = (1 << n);
dp[limit - 1] = 1.;
int[] bitPairs = new int[n + 1];
for (int bits = 0; bits <= n; ++bits) {
bitPairs[bits] = bits * (bits + 1);
bitPairs[bits] >>= 1;
}
for (int mask = limit - 2; mask >= 0; --mask) {
int pairs = bitPairs[bits];
for (int i = 0; i < n; i++) {
if ((mask & (1 << i)) == 0) continue;
for (int j = 0; j < n; j++) {
if ((mask & (1 << j)) == 0)
dp[mask] += dp[mask | (1 << j)] * p[i][j];
}
}
dp[mask] /= pairs;
}
for (int i = 0; i < n - 1; i++) {
System.
out.
print(dp
[1 << i
] + " "); }
System.
out.
println(dp
[1 << (n
- 1)]);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXN0YXRpYyBkb3VibGUgcFtdW107CglzdGF0aWMgZG91YmxlIGRwW107CglzdGF0aWMgaW50IG47CgoJcHVibGljIHN0YXRpYyBkb3VibGUgZihpbnQgbWFzaykgewoJCWlmIChkcFttYXNrXSA+IC0wLjUpCgkJCXJldHVybiBkcFttYXNrXTsKCgoKCQlyZXR1cm4gZHBbbWFza107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