CF1051D.Bicolorings

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

You are given a grid, consisting of 22 rows and nn columns. Each cell of this grid should be colored either black or white.

Two cells are considered neighbours if they have a common border and share the same color. Two cells AA and BB belong to the same component if they are neighbours, or if there is a neighbour of AA that belongs to the same component with BB .

Let's call some bicoloring beautiful if it has exactly kk components.

Count the number of beautiful bicolorings. The number can be big enough, so print the answer modulo 998244353998244353 .

输入格式

The only line contains two integers nn and kk ( 1n10001 \le n \le 1000 , 1k2n1 \le k \le 2n ) — the number of columns in a grid and the number of components required.

输出格式

Print a single integer — the number of beautiful bicolorings modulo 998244353998244353 .

输入输出样例

  • 输入#1

    3 4
    

    输出#1

    12
    
  • 输入#2

    4 1
    

    输出#2

    2
    
  • 输入#3

    1 2
    

    输出#3

    2
    

说明/提示

One of possible bicolorings in sample 11 :

首页