{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"You probably have played the game **Throwing Balls into the Basket**. It is a simple game. You have to throw a ball into a basket from a certain distance.\n\nOne day, we (the AIUB ACMMERs) were playing the game. But it was slightly different from the original game. In our version of the game, we were **N** people trying to throw balls into **M** identical Baskets. In each turn, we all were selecting a basket and trying to throw a ball into it. After the game, we saw exactly **S** balls were successful.\n\nNow you will be given the value of **N** and **M**. For each player, the probability of throwing a ball into any basket successfully is **P**. Assume that there are infinitely many balls and the probability of choosing a basket by any player is **1/M**. If multiple people choose a common basket and throw their ball, you can assume that their balls will not conflict, and the probability remains the same for scoring inside a basket. You have to find the expected number of balls entered into the baskets after **K** turns."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 100)**, denoting the number of test cases.\n\nEach case starts with a line containing three integers **N (1 \u0026le; N \u0026le; 16), M (1 \u0026le; M \u0026le; 100)** and **K (0 \u0026le; K \u0026le; 100)** and a real number **P (0 \u0026le; P \u0026le; 1)**. **P** contains at most three places after the decimal point."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the expected number of balls. Errors less than **10\u003csup\u003e-6\u003c/sup\u003e** will be ignored."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1 1 1 0.5\n1 1 2 0.5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 0.5\nCase 2: 1.000000\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}