QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 2048 MB Puntuación total: 100

#9706. 生命、宇宙以及一切终极问题的答案。

Estadísticas

几十年来,科学家们一直想知道从 0 到 100 的每一个数字是否都能表示为三个立方数之和,其中立方数是指一个数自乘三次的结果。

42 是最后一个没有被证明有解的数字——直到现在。

其解为: $$(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3 = 42$$

现在,Yen-Jen 对是否存在其他解产生了怀疑。但是,寻找这些解并不容易。Yen-Jen 想先找出简单的解。也就是说,对于方程 $a^3 + b^3 + c^3 = x$,Yen-Jen 希望为每个 $x \in [0, 200]$ 的整数找到至少一组解,其中 $|a|, |b|, |c| \le 5000$。

由于 Yen-Jen 还在忙于准备某些问题的测试数据,请帮他为每个 $x$ 找到至少一组解,或者告诉他当 $|a|, |b|, |c| \le 5000$ 时该解不存在。

输入格式

第一行包含一个整数 $T$,表示需要检查的 $x$ 的数量。

接下来的 $T$ 行,每行包含一个整数 $x$。

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

输出格式

对于每个测试用例,输出一行,包含三个用空格分隔的整数 $a, b, c$,使得 $a^3 + b^3 + c^3 = x$ 且 $|a|, |b|, |c| \le 5000$。如果解不存在,则输出 impossible

样例

样例输入 1

2
1
2

样例输出 1

1 1 -1
1 1 0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.