logo AlgoBeat OnlineJudge
登录 注册

#215373. [SWERC 2017] Macarons

内存限制:1024 MiB 时间限制:5000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Pierre is famous for his macarons. He makes round macarons, stored in square boxes of size , and oval-shaped macarons, stored in rectangular boxes of size (or, rotated, in rectangular boxes of size ). For the purpose of a buffet, Pierre wishes to tile a rectangular table of size with the two kinds of macarons, meaning that the table must be completely full, with no empty space left. The width of the table is small, for the guest to be able to grab the macarons easily, and the length of the table is large, to accommodate a huge number of guests. To keep the table pretty, the orientation of macarons should always be aligned with the sides of the table.

Pierre wishes to know how many ways there are to tile the table. Can you help him?

输入格式

The input consists of the following integers:

  • the value of , an integer, on the first line;
  • the value of , an integer, on the second line.

输出格式

The output should consist of the total number of tilings, given modulo , on a single line.

样例

样例输入 1

2
2

样例输出 1

7

样例输入 2

2
4

样例输出 2

71

数据范围与提示

Limits

The input satisfies and .