Universal Cup Judging System

Universal Cup

Límite de tiempo: 7.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓
Estadísticas

길이가 $n$인 배열 $a$에 대한 다음 연산을 생각해 봅시다. 인덱스 $i$ ($1 \le i < n$)를 선택한 다음, 다음과 같이 수행합니다.

  • $a_i=a_{i+1}$이면 $a_i$와 $a_{i+1}$을 모두 $1$씩 감소시킵니다.
  • 그렇지 않으면 $a_i$와 $a_{i+1}$ 중 더 작은 값을 $1$ 감소시킵니다.

배열의 모든 원소는 항상 음이 아니어야 하므로, 어떤 원소도 음수가 되지 않는 경우에만 연산을 적용할 수 있습니다.

이 연산을 임의의 횟수만큼 적용하여 배열의 모든 원소를 $0$으로 만들 수 있다면, 배열 $a$를 좋은 배열이라고 합니다. 연산을 한 번도 적용하지 않아도 됩니다.

$n$과 $k$가 주어집니다. 모든 $i$에 대해 $0 \le a_i \le k$를 만족하는 길이 $n$의 좋은 배열 $a$의 개수를 구하고, 이를 $998\,244\,353$으로 나눈 나머지를 구하세요.

입력

유일한 줄에 두 정수 $n$과 $k$ ($1 \le n,k \le 250\,000$)가 주어집니다.

출력

좋은 배열의 개수를 $998\,244\,353$으로 나눈 나머지를 나타내는 정수 하나를 출력하세요.

예제

입력 1

5 2

출력 1

36

입력 2

7 3

출력 2

855

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.