#T2068. Counting Towers
Counting Towers
链接: https://cses.fi/problemset/task/2413
板块: Dynamic Programming
时限: 1.00 s | 内存: 512 MB
题目描述
Your task is to build a tower whose width is and height is . You have an unlimited supply of blocks whose width and height are integers.
(题目原页含若干示意图片,此处从略。)
Given , how many different towers can you build? Mirrored and rotated towers are counted separately if they look different.
输入
The first input line contains an integer : the number of tests.
After this, there are lines, and each line contains an integer : the height of the tower.
输出
For each test, print the number of towers modulo .
数据范围
样例输入
3
2
6
1337
样例输出
8
2864
640403945
鲁公网安备37011202002910号