π𝓮s
View as PDFAlice and Bob have joined a competitive  game! Initially, there are 
 slices of good 
, and 
 slices of bad 
. With Alice going first, they will take turns picking one of the slices of 
 uniformly at random and eating it. If a player eats a good slice of 
, they gain one point, and if they eat a bad slice of 
, they lose one point. After each turn, they will bake a good/bad slice of 
 to replace the type of 
 that was just eaten. Then, they will bake 
 additional slices of 
, each with equal probability of being either good or bad.
Alice and Bob will spend the rest of eternity competing in this  game! Determine the limit of the expected value of Alice's points minus Bob's points after 
 turns, as 
 approaches infinity. To ensure the integrity of your solution, there will be 
 testcases.
Constraints
Subtask 1 [27%]
Subtask 𝓮 [31%]
Subtask π [42%]
Input Specification
The first line contains one integer, , the number of testcases.
The next  lines each contain three space-separated integers, 
, 
, and 
, describing each testcase. 
 is the initial number of good slices of 
, 
 is the initial number of bad slices of 
, and 
 is the number of randomly good/bad 
 slices which are added after each turn. It is guarenteed that there is at least one slice of 
 initially.
Output Specificiation
Output  lines, the 
 line containing one real number, the answer to the 
 testcase. Your answers will be considered correct if their absolute error is less than 
.
Sample Input
3
1 0 2
2 4 3
5 2 4
Sample Output
0.7853981633974483
-0.20456854629336979
0.2687567584009584
Explanation for Sample
For the first testcase, it can be shown that the limit of the expected value approaches 
For the second testcase, it can be shown that the limit of the expected value approaches 
For the third testcase, it can be shown that the limit of the expected value approaches 
Comments