On game forums there is always someone who blames the game for his own losses. A lack of realism or a cheating AI are the usual charges. Most of the time the real problem is skill.
The latest complaint comes from a player who says the computer cheats in the game he just bought. A battle is reported as a 70% chance to win and he loses it anyway. Another player takes his side and adds that he has lost five such battles in a row. The probability of that is (1−0.7)5=0.00243, so the game cannot be honest, he says. That number is right only if those five battles are the only ones that ever happen. A single game contains far more battles than five, so the chance that such a streak shows up somewhere is much larger. You decide to compute it yourself.
A battle ends in a win or a loss, and the probability of a win is p. Given N battles, find the probability that a losing streak of length at least L appears at least once. Battle outcomes are independent of each other and the random number generator is fair.
The first line contains the number of test cases T. Each of the next T lines contains N, L and p for one test case, separated by whitespace.
For each test case, print on its own line the probability that a losing streak of length at least L appears. Round the value to exactly nine digits after the decimal point and pad with zeros when digits are missing.