SP6852 CT16E - Fish
Description
_n_ fish, numbered from 1 to _n_, live in a lake. Every day right one pair of fish meet, and the probability of each other pair meeting is the same. If two fish with indexes i and j meet, the first will eat up the second with the probability _a_ $ _{ij} $ , and the second will eat up the first with the probability _a_ $ _{ji} $ = 1 - _a_ $ _{ij} $ . The described process goes on until there are at least two fish in the lake. For each fish find out the probability that it will survive to be the last in the lake.
Input Format
The first line contains integer _n_ (1 n ) — the amount of fish in the lake. Then there follow _n_ lines with _n_ real numbers each — matrix _a_. _a_ $ _{ij} $ (0 a $ _{ij} $ ) — the probability that fish with index _i_ eats up fish with index _j_. It's guaranteed that the main diagonal contains zeros only, and for other elements the following is true: _a_ $ _{ij} $ = 1 - _a_ $ _{ji} $ . All real numbers are given with not more than 6 characters after the decimal point.
Output Format
Output _n_ space-separated real numbers accurate to not less than 6 decimal places. Number with index _i_ should be equal to the probability that fish with index _i_ will survive to be the last in the lake.