Under construction

Still being built. Things may change

Primorial vs LCM

Time limit1sMemory limit256 MB

Summary
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 NN. Let LCM(1,2,…,N)\mathrm{LCM}(1, 2, \ldots, N) be the least common multiple of every integer from 11 to NN, and let P(N)P(N) be the product of every prime that is at most NN.

LCM(1,2,…,N)\mathrm{LCM}(1, 2, \ldots, N) is always divisible by P(N)P(N). Print that quotient modulo 10000000071000000007.

For example, with N=5N = 5 we have LCM(1,2,3,4,5)=60\mathrm{LCM}(1, 2, 3, 4, 5) = 60 and P(5)=2×3×5=30P(5) = 2 \times 3 \times 5 = 30, so the quotient is 60/30=260 / 30 = 2.

Input

The first line contains the number of test cases TT. (1≤T≤50 0001 \le T \le 50\,000)

Each of the next TT lines contains one integer NN. (2≤N≤10142 \le N \le 10^{14})

Output

For each test case print one line in the format Case x: S, where xx is the test case number starting from 11 and SS is the quotient modulo 10000000071000000007.

Examples3

  1. Example 1

    Input
    10
    2
    3
    4
    5
    6
    7
    8
    9
    10
    1000
    
    Expected output
    Case 1: 1
    Case 2: 1
    Case 3: 2
    Case 4: 2
    Case 5: 2
    Case 6: 2
    Case 7: 4
    Case 8: 12
    Case 9: 12
    Case 10: 744593350
    
  2. Example 2

    Input
    1
    2
    
    Expected output
    Case 1: 1
    
  3. Example 3

    Input
    3
    5
    16
    100
    
    Expected output
    Case 1: 2
    Case 2: 24
    Case 3: 30240