当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4363:Draw and paint

题目描述
Shadow is interested in the four-color theorem, now he wants to draw some lines on a rectangle paper to divide it into some parts, and then paint these parts with four different colors, the color of two adjacent parts must be different.
Firstly, Shadow draws a horizontal line and divides the paper into two parts (The height and width of two parts must be integer), then he paints one part with a kind of color.
Then he draws a vertical line and divides the other part into two parts (The height and width of two parts must be integer), then he paints one part with a kind of color.
Then he draws a horizontal line……That is to say, Shadow draws a horizontal line during an odd step, and a vertical line during an even step. Shadow repeats these operations until he can’t or doesn’t want to anymore.
Shadow can’t rotate or overturn the paper, do you know how many different ways can he draw lines and paint colors.
输入解释
The first line is one integer T indicates the number of test cases. (T <= 1000)
Then for each test case, there are two integers n and m ( 0 < n,m <= 40 )in one line, indicates the height and width of the rectangle paper.
输出解释
For each test case,output one integer in a line, the amount of ways can Shadow draw and paint mod 1000000007.
输入样例
3
1 1
1 2
2 1
输出样例
4
4
16
来自杭电HDUOJ的附加信息
Author FZU
Recommend zhuyuanchen520

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4363

最后修改于 2020-10-25T23:12:49+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 98304/98304K(Java/Others)