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

建议使用的浏览器:

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

3614:Card Game

题目描述

October 30, 2009.

After a night's journey, finally we arrived at Wuhan University in the morning to participate the International Collegiate Programming Contest (ACM-ICPC).

......

Before went to sleep, my team mate Zhang and I played a popular card-game called "Builds up Train" to have a release. Although the game is a liite stupid, but it may have a lot of fun ...


Assume there are 3 kinds of cards, and each of them has unlimited supply. If we take n cards out and arrange them in a row, we can get 3n differet rows. Now the problem is, how many different rows we can get using n cards and the number of cards of each kind is even?
输入解释
The first line of input is a single integer T (1 ≤ T ≤ 1000), representing the number of test cases. Then T test cases follows. Each test case is described by a single integer in a single line: n (1 ≤ n ≤ 2147483647);
输出解释
For each test case, output four integers in a line separated by spaces. The first integer is the number of different rows we can get using n cards when the number of cards of all kinds are even, the second integer is the number of different rows we can get using n cards when the number of cards of one kind is even and the number of cards of the other two are odd, the third integer is the number of different rows formed by n cards when the number of cards of two kinds are even and the number of cards of the other one is odd, the last number is the number of different rows formed by n cards when the number of cards of all three kinds are odd.

Output the answer mod 40007.

输入样例
3
1
2
2147483647
输出样例
0 0 3 0
3 6 0 0
0 0 442 13482
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-3614

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)