Sum of Product of Binomial Coefficients

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

문제

You are given integers $N$ and $K$. For a positive integer $k$, $f(k)$ is defined as follows.

  • The Sum of $\binom{N}{a_1} \times \binom{a_1}{a_2} \times \cdots \times \binom{a_{k-1}}{a_k}$ for all integer sequences $(a_1, a_2, \dots, a_k)$ that satisfy the condition $N \ge a_1 \ge a_2 \ge \dots \ge a_k \ge 0$.

Answer the remainder of $\sum_{k=1}^{K}{f(k)}$ divided by $998244353$.

For each input, solve $T$ test cases.

Note that $\binom{A}{B}$ represents "the number of ways to select $B$ distinct items from $A$ items" (i.e., the binomial coefficient).

입력

$T$

$\text{case}_1$

$\vdots$

$\text{case}_T$

Each test case is given in the following format.

$N$ $K$

출력

Output the remainder of $\sum_{k=1}^{K}{f(k)}$ divided by $998244353$ for each test case.

제한

  • All test cases consist of integers.
  • $1 \le T \le 10^5$
  • $0 \le N \le 10^9$
  • $1 \le K \le 2 \times 10^5$
  • The sum of $K$ in one test case does not exceed $2 \times 10^5$.