아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Sum of Three Cubes

시간 제한1초메모리 제한1024 MB

요약
50 미만의 N이 주어질 때 X^3+Y^3+Z^3=N을 만족하는 정수 X, Y, Z를 출력하고, 불가능하면 0을 출력한다.
난이도

보통10점 중 5점

유형
수학, 완전 탐색, 정수론
정답자
아직 제출이 없습니다

문제

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.

NXYZ
0000
1001
2011
3111
4No solution
5No solution
6-1-12
70-12
8002
9012
10112
11-2-23
12710-11
13No solution
14No solution
15-122
16-511-16091626
17122
18-1-23
190-23
201-23
21-11-1416
22No solution
23No solution
24-2901096694-1555055555515584139827
25-1-13
260-13
27003
28013
29113
30-283059965-22188885172220422932
31No solution
32No solution
338866128975287528-8778405442862239-2736111468807040
34-123
35023
36123
370-34
381-34
39117367134476-159380
40No solution
41No solution
42-805387388120759748043575814581751512602123297335631
43223
44-5-78
452-34
46-233
4767-8
48-23-2631
49No solution

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.

예제2

  1. 예제 1

    입력
    2
    
    예상 출력
    3737830626090 1490220318001 -3815176160999
    
  2. 예제 2

    입력
    5
    
    예상 출력
    0