410576: GYM104053 J Math Exam

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Math Examtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

There are many integer sequences in the world, and your mission is to find how many sequences are good.

An integer sequence $$$a_i$$$ of length $$$n$$$ is good if and only if all of these conditions holds:

  • $$$\forall i \in [1,n], 4S_i = {a_i}^2 + 2a_i + 1$$$.
  • $$$\forall i \in [1,n], |a_i| \le m$$$.

Where $$$S_i = \sum_{j=1}^i a_j$$$.

You will be given $$$n$$$ and $$$m$$$, and it is guaranteed that $$$m$$$ is odd.

Since the answer may be very large, you should calculate it modulo $$$998\, 244\, 353$$$.

Input

The only line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 10^7$$$, $$$1 \le m \leq 2n$$$, $$$m$$$ is odd).

Output

Output a single integer — the number of good sequences meeting the constraints, modulo $$$998\, 244\, 353$$$.

ExamplesInput
9 13
Output
124
Input
500 999
Output
195157058

加入题单

算法标签: