#P13939. [EC Final 2019] Black and White

[EC Final 2019] Black and White

题目描述

Master Pang\textit{Master Pang} walks from the bottom-left corner of a n×mn\times m chessboard to the top-right corner. The chessboard contains n+1n+1 horizontal line segments and m+1m+1 vertical line segments. The horizontal line segments are numbered from 00 to nn from bottom to top and the vertical ones are numbered from 00 to mm from left to right. The intersection of horizontal line segment rr and vertical segment cc is denoted by (r,c)(r,c). The bottom-left corner is (0,0)(0, 0) and the top-right corner is (n,m)(n, m). At each step, he can only walk from (x,y)(x, y) to (x,y+1)(x, y+1) or from (x,y)(x, y) to (x+1,y)(x + 1, y).

Each of the n×mn\times m cells is colored white or black. A cell with corners (i,j),(i+1,j),(i,j+1),(i+1,j+1)(i,j), (i+1,j), (i,j+1), (i+1,j+1) (0i<n,0j<m)(0\le i<n, 0\le j<m) is colored white if and only if ij(mod2)i\equiv j\pmod 2.

Given PangPang's walking path from (0,0)(0, 0) to (n,m)(n, m), his score is aba-b where aa is the number of white cells to the left of his walking path and bb is the number of black cells to the left of his walking path.

Help Master Pang\textit{Master Pang} count the number of walking paths with score kk modulo 998244353998244353.

输入格式

The first line contains a single integer TT --- the number of test cases (1T1001\le T \le 100).

Each of the next TT lines contains three integers nn, mm and kk ($1\le n\le 100000, 1\le m\le 100000, -100000\le k\le 100000$).

输出格式

For each test case, output a single integer --- the answer modulo 998244353998244353.

5
1 1 0
1 1 -1
2 2 1
2 2 0
4 4 1
1
0
1
4
16