Maximum Multiple
Time limit2sMemory limit256 MB
For each n, split it into three positive divisors x, y, z summing to n so that the product xyz is as large as possible, or report that no split exists.
- Level
Medium6 of 10
- Topics
- Math, Number theory, Brute force, Implementation
- Solved
- No attempts yet
Problem
Given an integer , Chiaki would like to find three positive integers , and such that: , , , and is maximum.
Input
There are multiple test cases. The first line of input contains an integer (), indicating the number of test cases. For each test case:
The first line contains an integer ().
Output
For each test case, output an integer denoting the maximum . If there no such integers, output instead.