OI Problems   关于

#c0e28z. Bags with Balls

时间限制:3 s       空间限制:500 MiB       标签: 数学 组合数学 斯特林数 第二类斯特林数 CodeForces 缺题解 

算法难度等级:0       思维难度等级:0       实现难度等级:0


本题来源于:Educational Codeforces Round 133 (Rated for Div. 2) Problem F

  • 简体中文
  • English

题目描述

这里有 nn 个袋子,每个袋子里面有 mm 个带有从 1m1\sim m 标记的球。对于每一个 1im1\leq i\leq m 来说,每个袋子中都一定存在一个带有 ii 标记的球。

你需要在每个袋子中取出一个球(所有的袋子都是不同的,比如在 11 号袋子取 22 号球 并且从 22 号袋子里取 11 号球与从 11 号袋子取 11 号球并且从 22 号袋子取 22 号球是不同的两种方案)然后计算出你取出的标号是奇数的球的数量,记这个数量为 FF

你的任务是计算所有可能的取球方案的 FkF^k 之和。

输入格式

第一行包含一个整数 tt1t50001\le t\le 5000)表示测试组数的数量。

每组第一行输入三个整数 n,m,kn, m, k1n,m9982443521\le n, m\le 9982443521k20001\le k\le 2000)。

输出格式

每组测试输出一个整数 FkF^k(意义见题面)。由于它可能会很大,请将它模 998244353998244353 后输出。

样例输入输出

5
2 3 8
1 1 1
1 5 10
3 7 2000
1337666 42424242 2000
1028
1
3
729229716
652219904

There are nn bags, each bag contains mm balls with numbers from 11 to mm . For every i[1,m]i \in [1, m] , there is exactly one ball with number ii in each bag.

You have to take exactly one ball from each bag (all bags are different, so, for example, taking the ball 11 from the first bag and the ball 22 from the second bag is not the same as taking the ball 22 from the first bag and the ball 11 from the second bag). After that, you calculate the number of balls with odd numbers among the ones you have taken. Let the number of these balls be FF .

Your task is to calculate the sum of FkF^k over all possible ways to take nn balls, one from each bag.

Input

The first line contains one integer tt ( 1t50001 \le t \le 5000 ) — the number of test cases.

Each test case consists of one line containing three integers nn , mm and kk ( 1n,m9982443521 \le n, m \le 998244352 ; 1k20001 \le k \le 2000 ).

Output

For each test case, print one integer — the sum of FkF^k over all possible ways to take nn balls, one from each bag. Since it can be huge, print it modulo 998244353998244353 .

Sample

5
2 3 8
1 1 1
1 5 10
3 7 2000
1337666 42424242 2000
1028
1
3
729229716
652219904