CF1178C.Tiles

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

The dimension of this tile is perfect for this kitchen, as he will need exactly w×hw \times h tiles without any scraps. That is, the width of the kitchen is ww tiles, and the height is hh 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.

The picture on the left shows one valid tiling of a 3×23 \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 998244353998244353 (a prime number).

输入格式

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

输出格式

Output a single integer nn — the remainder of the number of tilings when divided by 998244353998244353 .

输入输出样例

  • 输入#1

    2 2
    

    输出#1

    16
    
  • 输入#2

    2 4
    

    输出#2

    64
    
首页