|
||||||||||
Harmonious SetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 248 Accepted Submission(s): 98 Problem Description For a giving integer n ( n > 0 ) , the set Sn consists of the non negative integers less than n. For example:S5 = {0,1,2,3,4}. A subset of Sn is harmonious if and only if the sum of its elements is a multiply of n. Now your task is easy. For a given n , you should find the number of harmonious subset of Sn. Input There is a number C in the first line , meaning there are C cases . C is guaranteed no more than 300. Then C cases below. Each case is a positive integer n in a single line. n is not greater than 10^9. Output For each case , Output the answer mod 1000000007 in a single line . Sample Input
Sample Output
Source | ||||||||||
|