22313_TheTwinTower

2022-5-16 18:21| 发布者: Hocassian| 查看: 36| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506313877300-Problem List-采集的数据-后羿采集器.html

Pro.ID

22313

Title

The Twin Tower

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22313

AC

2

Submit

2

Ratio

100.00%

时间&空间限制

  • Time Limit: 16000/8000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    In recent years so many twins enrolled at Leiden University, that housing them has become a big problem. In an effort to accomodate everyone, the university has made plans to build a skyscraper of N floors high, with 9 rooms on each floor, laid out in a 3×3 square. According to these plans, everyone should be able to get a room next to or directly above or below their twin brother or sister. To be even more precise: the two rooms of a twin should either be at opposite sides of a common wall, or the floor of one room should be the ceiling of the other. For the sake of privacy, students never share a room.

    Today the university has tasked some poor soul (you!) to count all possible pairings of rooms that leave no room unpaired, modulo 10,007.

    输入

    The first line of the input contains a single number: the number of test cases to follow. Each test case has the following format:

    One line with an integer N, satisfying 0 ≤ N ≤ 5,000.

    输出

    Description

    In recent years so many twins enrolled at Leiden University, that housing them has become a big problem. In an effort to accomodate everyone, the university has made plans to build a skyscraper of N floors high, with 9 rooms on each floor, laid out in a 3×3 square. According to these plans, everyone should be able to get a room next to or directly above or below their twin brother or sister. To be even more precise: the two rooms of a twin should either be at opposite sides of a common wall, or the floor of one room should be the ceiling of the other. For the sake of privacy, students never share a room.

    Today the university has tasked some poor soul (you!) to count all possible pairings of rooms that leave no room unpaired, modulo 10,007.

    Input

    The first line of the input contains a single number: the number of test cases to follow. Each test case has the following format:

    One line with an integer N, satisfying 0 ≤ N ≤ 5,000.

    Output

    For every test case in the input, the output should contain a single number, on a single line: the number of possible configurations modulo 10007.

    Sample Input

    4
    2
    4
    1576
    2680

    Sample Output

    229
    7728
    229
    7728

    Source

    样例输入

    4
    2
    4
    1576
    2680

    样例输出

    229
    7728
    229
    7728

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部