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

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

hide comments
2015-03-20 18:46:06 utkarsha gaumat
@ shelly b answer for 10000 is correct
2015-02-22 13:51:44 Daksh
Nice Problem :)
2015-02-21 09:50:05 yvn
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
2015-02-21 08:20:08 CoNtRaDiCtIoN
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
2015-02-13 13:53:00 shelly b
is the answer for n=10000 927702802???

Last edit: 2015-02-13 13:53:27
2015-02-10 11:41:19 anand pandey
some test cases please
2015-02-07 16:59:17 Nadeem Ahamed
@[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
2015-02-06 18:07:11 utkarsha gaumat
for n=10000 is the answer 963098779??

re(vamsi): no

Last edit: 2015-02-06 19:55:17
2015-02-03 16:31:50 Shubham Porlikar
@Fata Nugraha:Can you please help me with the precision issue?
2015-02-02 05:15:39 fitcat
@Lakshman: Interesting question. Thanks.

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

Last edit: 2015-02-02 11:50:17
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.