Description
You probably has played the game "throwing Balls into the basket". It's a simple game. You had to throw a ball into a basket from a certain distance. One day we (the Aiub Acmmer) were playing the game. But it is slightly different from the main game. In our game we wereNPeople trying to throw balls intoMIdentical baskets. At the turn we all were selecting a basket and trying to throw a ball into it. After the game we saw exactlySBalls were successful. Now you'll be given the value ofNandM. For each player probability of throwing a ball to any basket successfully areP. Assume that there be infinitely many balls and the probability of choosing a basket by any player is1/m.If multiple people choose a common basket and throw their ball, you can assume that their balls would not conflict, and the Probability remains same for getting inside a basket. You have to find the expected number of balls entered into the baskets afterKTurns.
Input
Input starts with an integer T (≤100), denoting the number of test cases.
Each case starts with a line containing three integers N (1≤n≤16), M (1≤m≤100) and K (0≤k≤100) and a real number p (0 ≤ p ≤1). P contains at most three places after the decimal point.
Output
For each case, print the case number and the expected number of balls. Errors less than 10-6 'll be ignored.
Sample Input
2
1 1 1 0.5
1 1 2 0.5
Sample Output
Case 1:0.5
Case 2:1
The main topic: There are n people, M basket box, K rounds, each round each person can cast a ball, each person's hit rate is the same p, ask K-round, the goal of the ball in the cast is how much this topic I think high school teacher said the answer is N*k*p; 10,000 6 drifting over
LightOJ-1317 throwing Balls into the baskets