Descripción
On a pond, there is a row of lily pads, numbered 1 to N from left to right.
A frog is sitting on the leftmost lily pad (numbered 1). Every second, the frog either jumps forward to the next lily pad with probability Pf/100, jumps backward to the previous lily pad with probability Pb/100, or stays on the same lily pad with probability (100 - Pf - Pb)/100. If the frog is on the lily pad numbered k (k > 1), a forward jump moves her to lily pad k+1 and a backward jump moves her to lily pad k-1. If the frog is sitting on the leftmost lily pad, it will not be able to jump backward, so assume that it will stay on the lily pad instead of jumping backward.
What is the expected number of seconds before the frog reaches the rightmost lily (numbered N).
A frog is sitting on the leftmost lily pad (numbered 1). Every second, the frog either jumps forward to the next lily pad with probability Pf/100, jumps backward to the previous lily pad with probability Pb/100, or stays on the same lily pad with probability (100 - Pf - Pb)/100. If the frog is on the lily pad numbered k (k > 1), a forward jump moves her to lily pad k+1 and a backward jump moves her to lily pad k-1. If the frog is sitting on the leftmost lily pad, it will not be able to jump backward, so assume that it will stay on the lily pad instead of jumping backward.
What is the expected number of seconds before the frog reaches the rightmost lily (numbered N).
Especificación de entrada
First line of input contains the number of test cases T (T <= 100) to follow.
Each test case consists of a single line containing three space-separated integers N (2 <= N <= 25), the number of lily pads, Pf (1 <= Pf <= 100), and Pb (0 <= Pb <= 100, Pf+Pb <= 100), where Pf/100 and Pb/100 are the probabilities described in the statement.
Each test case consists of a single line containing three space-separated integers N (2 <= N <= 25), the number of lily pads, Pf (1 <= Pf <= 100), and Pb (0 <= Pb <= 100, Pf+Pb <= 100), where Pf/100 and Pb/100 are the probabilities described in the statement.
Especificación de salida
For each test
case, output the requested answer. To be accepted, your answer must have
a relative or an absolute error of less than 1e-6. You can print the
solution with any number of decimal places (even more than 10). It is
guaranteed that the answer fits in a double precision floating point
number.
Ejemplo de entrada
4 2 50 0 3 50 25 4 50 50 3 40 30
Ejemplo de salida
2 5 12 6.875