// Arup Guha
// 4/4/2024
// World Series Problem Code

import java.util.*;

public class worldseries {

	public static void main(String[] args) {
	
		// Get # of cases.
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
	
		// Process cases.
		for (int loop=0; loop<nC; loop++) {
		
			// a = # games won by team a, b = # of games won by team b.
			// p = probability of a winning one game.
			int a = stdin.nextInt();
			int b = stdin.nextInt();
			double p = stdin.nextDouble();
			
			// Fill in probabilities of team b winning games while team a wins nothing.
			double[][] dp = new double[a+1][b+1];
			dp[0][0] = 1;
			for (int j=1; j<=b; j++)
				dp[0][j] = dp[0][j-1]*(1-p);
			
			// Fill in the rest of the rows.
			for (int i=1; i<=a; i++) {
			
				// This is the probability of team a winning i games team b winning 0.
				dp[i][0] = dp[i-1][0]*p;
				
				// Add this up into two cases, team a wins last game, or team b wins last game.
				for (int j=1; j<=b; j++)
					dp[i][j] = dp[i-1][j]*p + dp[i][j-1]*(1-p);
			}
			
			// This is the probability of this occurring.
			System.out.println(dp[a][b]);
		}
	}

}