Under construction

Still being built. Things may change

Training, Round 3

Time limit1sMemory limit2048 MB

Summary
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 kk 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 pp distinct problems from the bank of nn problems on Brandon's Online Judge, independently and uniformly at random, and assigns them to Ashley. Tom generates a total of kk 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 nn (1≤n≤107)(1 \le n \le 10^7), kk (1≤k≤107)(1 \le k \le 10^7), and pp (1≤p≤n)(1 \le p \le n).

Output

Let pp be the probability that Ashley becomes annoyed. It can be shown that pp can be written as a rational number xy\frac{x}{y} with gcd⁡(x,y)=1\gcd(x, y) = 1 and y≢0(mod998244353)y \not\equiv 0 \pmod{998244353}. Define rr to be the unique integer in [0,998244353)[0, 998244353) such that r⋅y≡x(mod998244353)r \cdot y \equiv x \pmod{998244353}. Output rr.

Under the given constraints, rr is guaranteed to exist and be unique.

Hint

In the first sample, the probability that Ashley becomes annoyed is 79\frac{7}{9}. Since 110916040⋅9≡7(mod998244353)110916040 \cdot 9 \equiv 7 \pmod {998244353}, the output is 110916040.

In the second sample, Ashley always becomes annoyed. Since 1⋅1≡1(mod998244353)1 \cdot 1 \equiv 1 \pmod {998244353}, the output is 1.

In the third sample, Ashley never becomes annoyed. Since 0⋅1≡0(mod998244353)0 \cdot 1 \equiv 0 \pmod {998244353}, the output is 0.

Examples3

  1. Example 1

    Input
    3 3 1
    
    Expected output
    110916040
    
  2. Example 2

    Input
    3 2 2
    
    Expected output
    1
    
  3. Example 3

    Input
    3 1 1
    
    Expected output
    0