Codeforces Global Round 4
C
Tiles
Codeforces
1300
原题
← BD →
翻译中…

Bob is decorating his kitchen, more precisely, the floor. He has found a prime candidate for the tiles he will use. They come in a simple form factor — a square tile that is diagonally split into white and black part as depicted in the figure below.

翻译中…

image

翻译中…

The dimension of this tile is perfect for this kitchen, as he will need exactly $w \times h$ tiles without any scraps. That is, the width of the kitchen is $w$ tiles, and the height is $h$ tiles. As each tile can be rotated in one of four ways, he still needs to decide on how exactly he will tile the floor. There is a single aesthetic criterion that he wants to fulfil: two adjacent tiles must not share a colour on the edge — i.e. one of the tiles must have a white colour on the shared border, and the second one must be black.

翻译中…

image The picture on the left shows one valid tiling of a $3 \times 2$ kitchen. The picture on the right shows an invalid arrangement, as the bottom two tiles touch with their white parts.

翻译中…

Find the number of possible tilings. As this number may be large, output its remainder when divided by $998244353$ (a prime number).

翻译中…

Input

翻译中…

The only line contains two space separated integers $w$, $h$ ($1 \leq w,h \leq 1\,000$) — the width and height of the kitchen, measured in tiles.

翻译中…

Output

翻译中…

Output a single integer $n$ — the remainder of the number of tilings when divided by $998244353$.

翻译中…

样例

Input #1
2 2
Output #1
16
InputCopy OutputCopy
Input #2
2 4
Output #2
64
InputCopy OutputCopy
题目信息
题号
1178C
时间限制
1 s
内存限制
256 MB
标签
组合数学
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。