P6031 CF1278F Cards Enhanced Version

Background

[Original problem link](https://www.luogu.com.cn/problem/CF1278F)

Description

There are $m$ cards, and one of them is a joker. Shuffle these cards uniformly at random $n$ times. Let $x$ be the number of times the first card is the joker. Find the expected value of $x^k$. Take the answer modulo $998244353$.

Input Format

One line with three positive integers $n, m, k$.

Output Format

Output one integer in one line, which is the answer.

Explanation/Hint

Constraints For $20\%$ of the testdata, $1 \le k \le 5000$; For $40\%$ of the testdata, $1 \le k \le 10^5$; For $100\%$ of the testdata, $1 \le k \le 10^7$, $1 \le n, m \le 998244352$. Solution: iostream Data: NaCly\_Fish Translated by ChatGPT 5