All Tracks Math Problem

Micro and Optimus Prime
Tag(s):

Easy, Math

Problem
Editorial
Analytics

Micro has discovered new type of numbers, he is calling them Optimus Primes. He defined a function,\(f(x) = sum \space \space of \space powers \space of \space prime \space factors \space in \space x's \space prime \space factorization\) A number x is Optimus Prime if \(f(x)\) is exactly 1 less than its total number of divisors. Now, Micro is interested in finding out the smallest Optimus Prime having \(f(x) = N\). Help Micro with this task.

Input:
First line consists of a single integer T denoting the number of test cases.
Each of the following T lines consists of a single integer denoting N.

Output:
Print the required answer for each test case in a new line. Since answer can be large print it modulo \(10^9+7\).

Constraints:
\(1 \le T \le 10^5\)
\(1 \le N \le 10^{18}\)

SAMPLE INPUT
1
2
SAMPLE OUTPUT
4
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

Sapient Global Markets

Challenge Name

Sapient Global Markets Core Java Hiring Challenge

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications

?