Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

brute force

combinatorics

dp

fft

math

*2700

No tag edit access

The problem statement has recently been changed. View the changes.

×
F. Permutation Counting

time limit per test

4 secondsmemory limit per test

512 megabytesinput

standard inputoutput

standard outputCalculate the number of permutations $$$p$$$ of size $$$n$$$ with exactly $$$k$$$ inversions (pairs of indices $$$(i, j)$$$ such that $$$i < j$$$ and $$$p_i > p_j$$$) and exactly $$$x$$$ indices $$$i$$$ such that $$$p_i > p_{i+1}$$$.

Yep, that's the whole problem. Good luck!

Input

The first line contains one integer $$$t$$$ ($$$1 \le t \le 3 \cdot 10^4$$$) — the number of test cases.

Each test case consists of one line which contains three integers $$$n$$$, $$$k$$$ and $$$x$$$ ($$$1 \le n \le 998244352$$$; $$$1 \le k \le 11$$$; $$$1 \le x \le 11$$$).

Output

For each test case, print one integer — the answer to the problem, taken modulo $$$998244353$$$.

Example

Input

5 10 6 4 7 3 1 163316 11 7 136373 11 1 325902 11 11

Output

465 12 986128624 7636394 57118194

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/28/2024 06:39:44 (k3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|