Coffin Tiles
Time limit1sMemory limit128 MB
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 identical square tiles can be laid out as an rectangle whenever . Two rectangles count as the same shape when they share the same pair of side lengths, so and are not distinct. The number of dimensionally-unique rectangles that tiles can form is therefore the number of unordered factor pairs of .
For each given positive integer , output the minimal number of tiles that can be arranged into exactly dimensionally-unique rectangles. For example, for the answer is : with tiles you can build a rectangle and a rectangle, and no smaller number of tiles yields exactly two rectangles.
If the minimal number of tiles needed is greater than , output Too big instead.
Input
The first integer is , the number of queries to read. It is followed by positive integers , separated by whitespace (the values may span one or more lines).
Output
For each integer , print on its own line the minimal number of unit squares that can be arranged into exactly dimensionally-unique rectangles, or Too big if that number is greater than .