• [1193] DIY Cube

  • 时间限制: 2000 ms 内存限制: 32768 K
  • 问题描述
  • Mr. D is interesting in combinatorial enumeration. Now he want to find out the number of ways on painting the vertexes of a cube. Suppose there are C different colors and two paintings are considered the same if they can transform from one to another by rotation.
  • 输入
  • There are multiple test cases in the input, the first line of input contains an integer denoting the number of test cases.
    For each test case, there are only one integer C, denoting the number of colors. (1 <= C <= 1000000000)
  • 输出
  • For each test case, output the the number of painting ways. And if the number is equal or larger than 10^15, output the last 15 digits.
  • 样例输入
  • 3
    1
    2
    112
    
  • 样例输出
  • Case 1: 1
    Case 2: 23
    Case 3: 031651434916928
    
  • 提示
  • 来源
  • HyperHexagon’s Summer Day Gift
  • 操作

显示春菜