## 24 hour archive: Problem

###
** 2156
- Ping Pong Probability** ** 2156 - Ping Pong Probability** ** 2156 - Ping Pong Probability**

#### Description

Two Ping Pong players agree to play several games. The players are evenly matched. However, the person serving first has a probability p of winning that game. A serves the first game and thereafter the loser serves first. What is the Probability that A wins the n-th game?

#### Input specification

Number of test cases T followed by T lines of 'n' - the number
of games played; and 'p' probability of person serving first winning (0 < T, n < 100).

;jsessionid=96AF391FC2BE9F8412183D1015D5613B
Number of test cases T followed by T lines of 'n' - the number
of games played; and 'p' probability of person serving first winning (0 < T, n < 100).

;jsessionid=96AF391FC2BE9F8412183D1015D5613B
Number of test cases T followed by T lines of 'n' - the number
of games played; and 'p' probability of person serving first winning (0 < T, n < 100).

;jsessionid=96AF391FC2BE9F8412183D1015D5613B
#### Output specification

Print for each test case the probability of A winning. The number must have a precision of 5 decimal digits.

#### Sample input

`2`

4 0.7

7 0.7

#### Sample output

`0.48720`

0.50082

#### Hint(s)

http://coj.uci.cu/24h/

http://coj.uci.cu/24h/

http://coj.uci.cu/24h/