QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 2048 MB Total points: 100

#9706. The Answer to the Ultimate Question of Life, The Universe, and Everything.

统计

For decades, scientists have wondered whether each of the numbers from 0 to 100 could be represented as the sum of three cubes, where a cube is the same number multiplied together three times.

42 was the last number without a proven solution — until now.

The solution is $$(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3 = 42$$

Now, Yen-Jen is suspicious of the existence of other solutions. But, the solutions are not so trivial to find out. Yen-Jen wants to find out easy solutions first. That is, for the equation $a^3 + b^3 + c^3 = x$, Yen-Jen wants to find out at least one solution for each integer $x$ in $[0, 200]$, where $|a|, |b|, |c| \le 5000$.

Since Yen-Jen is still busy preparing the test data of some(this?) problem, please help him find out at least one solution for each $x$ or tell him that the solution doesn't exist when $|a|, |b|, |c| \le 5000$.

Input

The first line contains an integer $T$ indicating the number of $x$ to be checked.

Following $T$ lines each contains one integer $x$.

  • $1 \le T \le 10$
  • $0 \le x \le 200$

Output

For each test case, output one line containing three space-separated integers $a, b, c$ such that $a^3 + b^3 + c^3 = x$ and $|a|, |b|, |c| \le 5000$. If the solution doesn't exist, output $\texttt{"impossible"}$.

Sample Input

2
1
2

Sample Output

1 1 -1
1 1 0
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.