SMALL - Smallest Number


Your task is extremely simple, for a given number N you have to find the smallest number which is divisible by all numbers from 1 to N without leaving any remainder. As the number can be very large print the answer modulo 1000000007.

Input

Input starts with a positive integer T < 501 in a single line, then T lines follow. Each of the T lines contains one positive integer N < 10001.

Output

For every N print the desired number.

Example

Input:
1
5

Output:
60

hide comments
utkarsha gaumat: 2015-03-20 18:46:06

@ shelly b answer for 10000 is correct

Daksh: 2015-02-22 13:51:44

Nice Problem :)

yvn: 2015-02-21 09:50:05

what is answer the for n = 10000
and n = 999
--(Lakshman)->No other test cases will be provided.However your logic is wrong.

Last edit: 2015-02-21 09:57:47
CoNtRaDiCtIoN: 2015-02-21 08:20:08

continous wrong answers @Lakshman kindly look into solution and tell the probable mistake !!

-(Lakshman)-->You have precision issue, your algorithm is correct.

yeah got it thanks

Last edit: 2015-02-21 13:05:37
shelly b: 2015-02-13 13:53:00

is the answer for n=10000 927702802???

Last edit: 2015-02-13 13:53:27
anand pandey: 2015-02-10 11:41:19

some test cases please

Nadeem Ahamed : 2015-02-07 16:59:17

@[Lakshman]
Can you please check my submission(13620868) because I am getting the same output for both, the brute force and this algo.

--(Lakshman)-->You have precision issue.

Last edit: 2015-02-08 12:30:45
utkarsha gaumat: 2015-02-06 18:07:11

for n=10000 is the answer 963098779??

re(vamsi): no

Last edit: 2015-02-06 19:55:17
Shubham Porlikar: 2015-02-03 16:31:50

@Fata Nugraha:Can you please help me with the precision issue?

fitcat: 2015-02-02 05:15:39

@Lakshman: Interesting question. Thanks.

--(Lakshman)-->You are welcome!!

Last edit: 2015-02-02 11:50:17

Added by:[Lakshman]
Date:2015-01-24
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 JS-MONKEY