Primorial vs LCM
Time limit1sMemory limit256 MB
Given N, divide the least common multiple of 1 to N by the product of all primes up to N and print the quotient modulo 1000000007.
- Level
Medium7 of 10
- Topics
- Number theory, Math
- Solved
- No attempts yet
Problem
You are given an integer . Let be the least common multiple of every integer from to , and let be the product of every prime that is at most .
is always divisible by . Print that quotient modulo .
For example, with we have and , so the quotient is .
Input
The first line contains the number of test cases . ()
Each of the next lines contains one integer . ()
Output
For each test case print one line in the format Case x: S, where is the test case number starting from and is the quotient modulo .