| SanSi Cup 2026 Qualification round |
|---|
| Finished |
The Gossip Club 2880 was founded and its $$$n$$$ members are furious. So furious that each of them is going to try to cancel ("funar") one person of the club, chosen at random. They are so crazy that they can even cancel themselves.
Each of the $$$n$$$ members chooses whom to cancel among the $$$n$$$ members, including themselves, with the same probability for each one. Each cancel attempt has a $$$p\%$$$ probability of being effective, regardless of what happens with the others. A person ends up cancelled ("funado") if at least one cancel attempt against them is effective. If there are several cancel attempts against a person, it is more likely that they end up cancelled.
What is the probability that exactly $$$k$$$ people end up cancelled?
The first line contains an integer $$$T$$$, the number of test cases.
Each of the following $$$T$$$ lines contains three integers $$$n$$$, $$$k$$$ and $$$p$$$.
Constraints
For each case, the probability is an irreducible fraction $$$a/b$$$. Print on one line $$$a \cdot b^{-1} \bmod (998244353)$$$, where $$$b^{-1}$$$ is the integer such that $$$b \cdot b^{-1} \equiv 1 \pmod{998244353}$$$. It can be shown that it always exists.
3 1 1 50 3 2 100 2 0 50
499122177 665496236 748683265
2 3 1 50 4 2 30
928921829 435601081
| Name |
|---|


