CF1490C.Sum of Cubes

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Sum of Cubes

You are given a positive integer xx. Check whether the number xx is representable as the sum of the cubes of two positive integers.

Formally, you need to check if there are two integers aa and bb (1a,b1 \le a, b) such that a3+b3=xa^3+b^3=x.

For example, if x=35x = 35, then the numbers a=2a=2 and b=3b=3 are suitable (23+33=8+27=352^3+3^3=8+27=35). If x=4x=4, then no pair of numbers aa and bb is suitable.

Input

The first line contains one integer tt (1t1001 \le t \le 100) — the number of test cases. Then tt test cases follow.

Each test case contains one integer xx (1x10121 \le x \le 10^{12}).

Please note, that the input for some test cases won't fit into 3232-bit integer type, so you should use at least 6464-bit integer type in your programming language.

Output

For each test case, output on a separate line:

  • "YES" if xx is representable as the sum of the cubes of two positive integers.
  • "NO" otherwise.

You can output "YES" and "NO" in any case (for example, the strings yEs, yes, Yes and YES will be recognized as positive).

Note

The number 11 is not representable as the sum of two cubes.

The number 22 is represented as 13+131^3+1^3.

The number 44 is not representable as the sum of two cubes.

The number 3434 is not representable as the sum of two cubes.

The number 3535 is represented as 23+332^3+3^3.

The number 1616 is represented as 23+232^3+2^3.

The number 703657519796703657519796 is represented as 57793+799335779^3+7993^3.

Samples

7
1
2
4
34
35
16
703657519796
NO
YES
NO
NO
YES
YES
YES

在线编程 IDE

建议全屏模式获得最佳体验