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
sankalp_7:
2021-07-10 21:45:47
Can also be solved by using sieve concept. |
|
mahilewets:
2017-09-19 21:29:00
Calculate answers for all x, 1<=x<=10000, during run time
|
|
stranger77:
2017-08-13 07:41:03
no precomputation. Done in 0.01sec |
|
aman224:
2017-03-01 13:11:10
No precomputation needed
|
|
madhavgaba:
2017-01-01 13:41:39
precomputation rocks:D |
|
thug_life:
2016-11-22 17:02:27
@Lakshman would you check whats wrong with my code..its giving correct answers for every test cases I borrowed from spoj toolkit.But still showing wrong answer.Please reply soon.18238934 is the id
|
|
Amitayush Thakur:
2016-10-05 12:08:23
Read 1000000007 as 10**8 + 7. Got 1 WA :( then got AC. |
|
Shubham Gupta:
2016-07-08 00:28:10
Superb question.
|
|
Piyush Kumar:
2016-06-30 19:51:34
Python like languages are unfair to this question :( . Beautiful question with a peasant solution in Python.
|
|
Siddharth Singh:
2016-06-20 17:07:47
Same Logic In Python Gives AC
|
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 |