102045: [AtCoder]ABC204 F - Hanjo 2

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

Description

Score : $600$ points

Problem Statement

We have a rectangular room that is $H$ meters long and $W$ meters wide.
We will fill this entire room with tatami (rectangular mats) that are $2$ meters long and $1$ meter wide, and hanjo (square mats) that are $1$ meter long and $1$ meter wide. Each tatami can be placed vertically or horizontally.
How many ways are there to fill the room?
We distinguish ways that match only after rotation or reflection.

Since the count can be enormous, find it modulo $998244353$.

Constraints

  • $1 \leq H \leq 6$
  • $1 \leq W \leq 10^{12}$

Input

Input is given from Standard Input in the following format:

$H$ $W$

Output

Print the answer.


Sample Input 1

2 2

Sample Output 1

7

We have the following seven ways:


Sample Input 2

3 3

Sample Output 2

131

Sample Input 3

5 100

Sample Output 3

379944232

Be sure to find the count modulo $998244353$.

Input

题意翻译

有一个宽$H$($1≤H≤6$),长$W$($1≤W≤10^{12}$)的房间,现在用两种地板砖铺地板:长2,宽1的长方形地板砖和边长为1的正方形地板砖. 长方形地板砖可以旋转成长1,宽2的长方形地板砖. 求有多少种方法可以铺满这个房间. ## 输入格式 两个数$H$,$W$ ## 输出格式 一个数,表示有多少种方法,结果模998244353

加入题单

算法标签: