KIMO2 - simple calculation

no tags 

The problem statement is very, easy just compute the value of x given the value of n.

Input

The first line will contains T the number of test cases, the following T lines will contain the value of n.

1 <= T <= 10^5

1 <= n < 10^7

Output

For every n print the value of x % (10^9 + 7).

Example

Input:
5
1
5
10
15
33

Output:
1
80
5120
245760
733919781

hide comments
walid_salah: 2016-04-21 19:26:45

peace of cauchen :D

Hussein Aassem: 2015-03-24 09:52:03

the formula of the output needs a pair of parentheses for clarity

x % (10^9+7)

aqfaridi: 2013-08-18 09:31:47

expo..

Ouditchya Sinha: 2013-05-23 17:02:40

Piece of Cake. AC in 0.13s :)

Rajarshi Sarkar: 2013-05-18 16:12:19

@Lakshman >> Mayb an overflow ;)
Nice problem, reminds me of my high school days :)

[Lakshman]: 2013-05-18 15:55:16

@abdelkarim can you please tell me why WA..this is simple and on direct formula

My mistake...got it AC...Good for beginners.....Silly mistake cause 7 WA...
Thanks..@Rajarshi Sarkar

Last edit: 2013-05-18 16:20:17
[Lakshman]: 2013-05-18 12:41:53

I think this is on direct formula..******** am I wrong..?
Ans(Tjandra): Yes, it's correct. But, please don't spoil the formula ;-)

Last edit: 2013-05-18 12:50:49
(Tjandra Satria Gunawan)(曾毅昆): 2013-05-17 20:04:37

AC with less than 123B in C without any opti.. But maybe impossible to pass with slow language..

Last edit: 2013-05-17 18:37:40

Added by:abdelkarim
Date:2013-05-17
Time limit:2s
Source limit:5000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:owner