Sum of Three Cubes
시간 제한1초메모리 제한1024 MB
50 미만의 N이 주어질 때 X^3+Y^3+Z^3=N을 만족하는 정수 X, Y, Z를 출력하고, 불가능하면 0을 출력한다.
문제
Recently, a mathematician has just found three cube numbers that sum up to 42 using over a million hours of computing time. With this breakthrough, we have found three cube numbers that sum up to all non-negative integers less than 100 if it is possible to do so. In other words, for every 0 ≤ N < 100, we have found the triples (X, Y, Z) such that X3 + Y3 + Z3 = N, or we have proved that no such triplet exists.
The following is a table of (X, Y, Z) that satisfies X3 + Y3 + Z3 = N for 0 ≤ N < 50.
Reading a long table is a tedious job, so you would like to create a program that takes N as an input, and produce X, Y, Z as the output. The value of X, Y, and Z must be an integer not less than −1018 and not more than 1018.
입력
Input begins with a line containing an integer: N (0 ≤ N < 50).
출력
Output in a line three integers (separated by a single space): X Y Z that satisfies the condition given in the problem statement. If there is more than one solution, you can output any of them. If there is no solution, output 0 instead.