F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Who's Aunt Zhang

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 665    Accepted Submission(s): 553


Problem Description
Aunt Zhang, well known as ÕÅ°¢ÒÌ, is a fan of Rubik¡¯s cube. One day she buys a new one and would like to color it as a gift to send to Teacher Liu, well known as ÁõÀÏʦ. As Aunt Zhang is so ingenuity, she can color all the cube¡¯s points, edges and faces with K different color. Now Aunt Zhang wants to know how many different cubes she can get. Two cubes are considered as the same if and only if one can change to another ONLY by rotating the WHOLE cube. Note that every face of Rubik¡¯s cube is consists of nine small faces. Aunt Zhang can color arbitrary color as she like which means that she doesn¡¯t need to color the nine small faces with same color in a big face. You can assume that Aunt Zhang has 74 different elements to color. (8 points + 12 edges + 9*6=54 small faces)

 

Input
The first line of the date is an integer T, which is the number of the text cases.
Then T cases follow, each case contains one integer K, which is the number of colors. T<=100, K<=100.
 

Output
For each case, you should output the number of different cubes.
Give your answer modulo 10007.
 

Sample Input
3 1 2 3
 

Sample Output
Case 1: 1 Case 2: 1330 Case 3: 9505
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-03 17:13:01, Gzip enabled