3455: Maximum Multiple

内存限制:32 MB 时间限制:2.000 S
评测方式:文本比较 命题人:
提交:1 解决:1

题目描述

Given an integer n, Chiaki would like to find three positive integers xy and z such that: n=x+y+zx∣ny∣nz∣n and xyz is maximum.

输入

There are multiple test cases. The first line of input contains an integer T (1≤T≤106), indicating the number of test cases. For each test case:
The first line contains an integer n (1≤n≤106).

输出

For each test case, output an integer denoting the maximum xyz. If there no such integers, output −1 instead.

样例输入 复制

3
1
2
3

样例输出 复制

-1
-1
1