Under construction

Still being built. Things may change

Coffin Tiles

Time limit1sMemory limit128 MB

Summary
For each n, find the smallest number of tiles whose unordered factor-pair count equals exactly n, or report Too big above 1000000.
Level

Hard8 of 10

Topics
Number theory, Brute force, Implementation, Math
Solved
No attempts yet

Problem

Square tiles are arranged into rectangles to decorate a lid. A set of kk identical square tiles can be laid out as an a×ba \times b rectangle whenever a×b=ka \times b = k. Two rectangles count as the same shape when they share the same pair of side lengths, so a×ba \times b and b×ab \times a are not distinct. The number of dimensionally-unique rectangles that kk tiles can form is therefore the number of unordered factor pairs of kk.

For each given positive integer nn, output the minimal number of tiles that can be arranged into exactly nn dimensionally-unique rectangles. For example, for n=2n = 2 the answer is 44: with 44 tiles you can build a 1×41 \times 4 rectangle and a 2×22 \times 2 rectangle, and no smaller number of tiles yields exactly two rectangles.

If the minimal number of tiles needed is greater than 1,000,0001{,}000{,}000, output Too big instead.

Input

The first integer is TT, the number of queries to read. It is followed by TT positive integers nn, separated by whitespace (the values may span one or more lines).

Output

For each integer nn, print on its own line the minimal number of unit squares that can be arranged into exactly nn dimensionally-unique rectangles, or Too big if that number is greater than 1,000,0001{,}000{,}000.

Examples3

  1. Example 1

    Input
    5
    1 4 19 48 71
    
    Expected output
    1
    24
    786432
    27720
    Too big
    
  2. Example 2

    Input
    6
    1 2 3 4 5 6
    
    Expected output
    1
    4
    12
    24
    36
    60
    
  3. Example 3

    Input
    1
    2
    
    Expected output
    4