MINI - MINI IN DANGER!!!
There is a n x n board. Tom is playing a game in which there are n*n blocks which can be filled with numbers from 0 to n-1 in some arbitrary way. The rule of the game is that the board should be filled in such a way that the sum of each row and column should be divisible by n.
Tom has set the board in a winning configuration. But now the intelligent and notorious daughter of Tom, Mini comes and changes the configuration of the board. But she is scared now as her dad is about to come home.She realizes that dad will get angry if he sees that the board is not in the winning configuration and he will scold her. Mini wants to know the number of ways in which the board can be restored to a winning configuration. Please help her out.
Input
First line consists of an integer T and then T test cases follow, each having the value of N.
Output
For each test case you have to output the number of ways modulo 1000000009 in a separate line.
Constraints
T <= 10^6
N will be between 1 and 2^64-1 and not a multiple of 1000000009
Sample
Input: 1 1 Output: 1
hide comments
[Lakshman]:
2014-06-14 13:50:21
What is the answer for 3? Can some One give me a test case. |
Added by: | anuj |
Date: | 2012-02-05 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | own |