Permutation

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

You are given a permutation p_1,p_2,,p_np\_1, p\_2, \dots, p\_n. You can do the following operations repeatedly:

  • Choose an interval p_l,p_l+1,,p_l+c(l1,l+cn)p\_{l}, p\_{l+1}, \dots, p\_{l+c} (l \geq 1, l+c \leq n) where p_lp\_l is the smallest element in this interval, you can permutate p_l+1,,p_l+cp\_{l+1}, \dots, p\_{l+c} in arbitrary way.
  • Choose an interval p_l,p_l+1,,p_l+c(l1,l+cn)p\_{l}, p\_{l+1}, \dots, p\_{l+c} (l\geq 1, l+c \leq n) where p_l+cp\_{l+c} is the smallest element in this interval, you can permutate p_l,,p_l+c1p\_{l}, \dots, p\_{l+c-1} in arbitrary way.

You want to know how many distinct permutations you can get using operations. The answer can be large, output the answer modulo 998244353998244353.

입력

The first line contains an integer TT denoting the number of test cases (1T1000001\le T\le 100000).

The first line in a test case contains two integers nn and cc (2c5000002\le c \le 500000, 2n5000002\le n\le 500000). The sum of nn over all test cases does not exceed 500000500000.

The second line in a test case contains a permutation p_1,,p_np\_1,\ldots, p\_n (1p_in1\le p\_i\le n).

출력

For each test case, output one line containing the answer modulo 998244353998244353.