Training, Round 3
Time limit1sMemory limit2048 MB
Given n problems, k weeks, and p problems picked per week, find the probability that some two weekly sets share a problem, modulo 998244353.
- Level
Medium5 of 10
- Topics
- Math, Combinatorics
- Solved
- No attempts yet
Problem
Ashley is training for another programming contest on Brandon's Online Judge.
Ashley has weeks left to train for her next programming contest. Her coach, Tom, is very busy and no longer picks specific problems for Ashley. At the start of every week, Tom picks distinct problems from the bank of problems on Brandon's Online Judge, independently and uniformly at random, and assigns them to Ashley. Tom generates a total of sets of problems in this manner.
Ashley solves every problem that Tom picks. However, she gets annoyed if two different weeks share at least one problem, because she wants to solve unique problems.
Compute the probability that Ashley becomes annoyed.
Input
The input is one line with three integers , , and .
Output
Let be the probability that Ashley becomes annoyed. It can be shown that can be written as a rational number with and . Define to be the unique integer in such that . Output .
Under the given constraints, is guaranteed to exist and be unique.
Hint
In the first sample, the probability that Ashley becomes annoyed is . Since , the output is 110916040.
In the second sample, Ashley always becomes annoyed. Since , the output is 1.
In the third sample, Ashley never becomes annoyed. Since , the output is 0.