Logo
(追記) (追記ここまで)

30354번 - Sum of Product of Binomial Coefficients 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB62534088.889%

문제

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$.

예제 입력 1

3
3 3
0 1
31415 92653

예제 출력 1

99
1
276482222

힌트

출처

Contest > ICPC Japanese Alumni Group > JAG Summer Camp > JAG Summer Camp 2023 Day 2 A번

Camp > Petrozavodsk Programming Camp > Summer 2024 > Day 1: Welcome Contest A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /