CF1278F.Cards

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Consider the following experiment. You have a deck of mm cards, and exactly one card is a joker. nn times, you do the following: shuffle the deck, take the top card of the deck, look at it and return it into the deck.

Let xx be the number of times you have taken the joker out of the deck during this experiment. Assuming that every time you shuffle the deck, all m!m! possible permutations of cards are equiprobable, what is the expected value of xkx^k ? Print the answer modulo 998244353998244353 .

输入格式

The only line contains three integers nn , mm and kk ( 1n,m<9982443531 \le n, m < 998244353 , 1k50001 \le k \le 5000 ).

输出格式

Print one integer — the expected value of xkx^k , taken modulo 998244353998244353 (the answer can always be represented as an irreducible fraction ab\frac{a}{b} , where bmod9982443530b \mod 998244353 \ne 0 ; you have to print ab1mod998244353a \cdot b^{-1} \mod 998244353 ).

输入输出样例

  • 输入#1

    1 1 1
    

    输出#1

    1
    
  • 输入#2

    1 1 5000
    

    输出#2

    1
    
  • 输入#3

    2 2 2
    

    输出#3

    499122178
    
  • 输入#4

    998244352 1337 5000
    

    输出#4

    326459680
    
首页