|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||256 MB||18||7||7||77.778%|
On internet forums for games, you’ll always have a bunch of guys complaining about how they’re losing. It’s always something wrong with the game. Lack of realism and cheating AI is among the top choices. Sadly, it’s mostly just lacking skills. To the rest of us, this becomes an everlasting quest to show them how wrong they are!
The latest in the never ending series is a guy claiming that the computer cheats in his newest game. Even though a 70% probability of winning is reported for a battle, he still loses! He is quickly shot down by our army of knowit-alls, but another guy rushes to his support. Even though you can lose a single battle at these odds, he has observed 5 such losses in a row! The probability of that is (1 − 0.7)5 = 0.00243. Too low to be possible, he claims! Being such an honorable know-it-all, you explain how that might be true if those 5 battles were the only events overall, but throughout a whole game there are a lot more battles than that. The probability of observing such a streak is much larger! To back up your statement, you decide to calculate such probabilities.
A battle has two outcomes, win or lose. The probability of winning is given by p. Given that you simulate N battles, what is the probability of witnessing a losing streak of at least L battles?
The first line of input contains a single number T, the number of test cases to follow. Each test case consists of one line containing the three numbers N, L and p, separated by whitespace.
For each test case, output a line containing a single floating-point number, the probability of witnessing a losing streak of at least L battles.
2 5 5 0.7 10 5 0.7