CF1671F.Permutation Counting

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Calculate the number of permutations pp of size nn with exactly kk inversions (pairs of indices (i,j)(i, j) such that i<ji < j and pi>pjp_i > p_j ) and exactly xx indices ii such that pi>pi+1p_i > p_{i+1} .

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

输入格式

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

Each test case consists of one line which contains three integers nn , kk and xx ( 1n9982443521 \le n \le 998244352 ; 1k111 \le k \le 11 ; 1x111 \le x \le 11 ).

输出格式

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

输入输出样例

  • 输入#1

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

    输出#1

    465
    12
    986128624
    7636394
    57118194
首页