spoj#WINGOLD. Win gold medal

Win gold medal

In a game there are infinite number of levels. In order to go to the next level,a player has to clear all the preceding levels. A player cant go further,if he fails to clear the level. Each player has a probability p of clearing the level (which is independent of the other players and the level number). For example, if p =1/2 there is a probability 2^(-n-1) that a particular game will have exactly n levels cleared.A player will get Gold medal if he clears the maximum number of levels. If the maximum number of levels reached is common between two or more players, then no one wins the gold medal.What is the probability that a Gold medal is given to any player?

Input

T number of test cases each case follow
p n m . probability of clearing level for each player, number of player, number of levels in game

Output

T line each probability that gold medal is given round off to 4 significant digits

limit:

1<=T<10000
1<=n<1000
1<=m<100
0<=p<=1.0

Example

Input:
6
0.43 3 2
0.5 3 4
0.2 3 4
0.1 4 5
0.9 3 3
1.0 4 4
Output: 0.4490
0.6244
0.4184
0.3014
0.0275
0.0000