n을 합이 n인 세 양의 약수 x, y, z로 나눠 곱 xyz를 최대로 만들고, 그런 분할이 없으면 -1을 출력한다.
Given an integer nnn, Chiaki would like to find three positive integers xxx, yyy and zzz such that: n=x+y+zn=x+y+zn=x+y+z, x∣nx\mid nx∣n, y∣ny \mid ny∣n, z∣nz \mid nz∣n and xyzxyzxyz is maximum.
There are multiple test cases. The first line of input contains an integer TTT (1≤T≤1061 \le T \le 10^61≤T≤106), indicating the number of test cases. For each test case:
The first line contains an integer nnn (1≤n≤1061 \le n \le 10^{6}1≤n≤106).
For each test case, output an integer denoting the maximum xyzxyzxyz. If there no such integers, output −1-1−1 instead.