Hanjo 2

AtCoder
IDabc204_f
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
2 2
Output #1
7

We have the following seven ways:
![image](https://img.atcoder.jp/ghi/67d23276d886185110ef4d487123a911.png)
Input #2
3 3
Output #2
131
Input #3
5 100
Output #3
379944232

Be sure to find the count modulo $998244353$.
API Response (JSON)
{
  "problem": {
    "name": "Hanjo 2",
    "description": {
      "content": "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 ma",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc204_f"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We have a rectangular room that is $H$ meters long and $W$ meters wide.  \nWe will fill this entire room with tatami (rectangular mats) that are $2$ meters long and $1$ meter wide, and hanjo (square ma...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments