2819.Bad Luck Island

Time Limit: 1s Memory Limit: 256MB

The Bad Luck Island is inhabited by three kinds of species: r rocks, s scissors and p papers. At some moments of time two random individuals meet (all pairs of individuals can meet equiprobably), and if they belong to different species, then one individual kills the other one: a rock kills scissors, scissors kill paper, and paper kills a rock. Your task is to determine for each species what is the probability that this species will be the only one to inhabit this island after a long enough period of time.

Input Format(From the terminal/stdin)

The single line contains three integers r, s and p (1 \le r,s,p \le 100)- the original number of individuals in the species of rock, scissors and paper, respectively.

Output Format(To the terminal/stdout)

Print three space-separated real numbers: the probabilities, at which the rocks, the scissors and the paper will be the only surviving species, respectively. The answer will be considered correct if the relative or absolute error of each number doesn't exceed 10-9.

Sample Input 1

Copy
2 2 2
 · · \n

Sample Output 1

Copy
0.333333333333 0.333333333333 0.333333333333
              ·              ·              \n

Sample Input 2

Copy
2 1 2
 · · \n

Sample Output 2

Copy
0.150000000000 0.300000000000 0.550000000000
              ·              ·              \n

Sample Input 3

Copy
1 1 3
 · · \n

Sample Output 3

Copy
0.057142857143 0.657142857143 0.285714285714
              ·              ·              \n

Submit

请先 登录

© 2025 FAQs