Problem:
Score : 400 points

Problem Statement

Give a pair of integers (A, B) such that A^5-B^5 = X.
It is guaranteed that there exists such a pair for the given integer X.

Constraints

1 \leq X \leq 10^9

X is an integer.

There exists a pair of integers (A, B) satisfying the condition in Problem Statement.

Input

Input is given from Standard Input in the following format:

X

Output

Print A and B, with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.

A B

Sample Input 1

33

Sample Output 1

2 -1

For A=2 and B=-1, A^5-B^5 = 33.

Sample Input 2

1

Sample Output 2

0 -1

Solution in C++ (GCC 9.2.1) (judge verdict: Wrong Answer)

#include <stdio.h>
#include <cmath>
#include <unistd.h>


using lli = long long;
using llu = long long unsigned;
void fill(llu *fiv) {
    for (register int i=0; i<32000; i++) {
        fiv[i] = i*i*i*i*i;
    }
}

int main(void)
{

    llu fiv[32000]={0};
    fill(fiv);
    //for (register int i=1; i<32000; i++) { printf("fiv[%i]%llu ", i, fiv[i]); }
    llu x;//lli a,b,c,d;
    llu ipkn, inkn, ipkp, inkp;
    x=0;
    scanf("%lli", &x);

//    bool found = false;
    register lli i,k;
    i=0, k=0;
    for (i=0; i<32000; i++) {
        for (k=0; k<32000; k++) {
            ipkn=abs(1*fiv[i]+1*fiv[k]);
            ipkp=abs(1*fiv[i]-1*fiv[k]);
            inkn=abs(-1*fiv[i]+1*fiv[k]);
            inkp=abs(-1*fiv[i]-1*fiv[k]);
  //          printf("i:%lli, fivi:%lli, k:%lli, fivk:%lli\n",i, fiv[i], k, fiv[k]);
 //           printf("ipkn:%lli ipkp:%lli inkn:%lli inkp:%lli\n", ipkn,ipkp,inkn,inkp);
            if (ipkn==x || ipkp==x || inkn==x || inkp==x) {
                if (x==(llu)((lli)pow(i,5)-(lli)pow(k,5)) ||
                x==abs((lli)pow(i,5)-(lli)pow(-k,5)) ||
                x==abs((lli)pow(-i,5)-(lli)pow(k,5)) ||
                x==abs((lli)pow(-i,5)-(lli)pow(-k,5))) {
                    //found = true;
                    goto out;
                }

            }
//        sleep(1);
        }
    }
out:
    //lli ri=fiv[i], rk=fiv[k];
    if ((+1*fiv[i]+fiv[k])==x)
            k*=-1;
    else if ((+1*fiv[i]-fiv[k])==x)
            k*=1;
    else if ((-1*fiv[i]+fiv[k])==x)
            i*=-1, k*=-1;
    else if ((-1*fiv[i]-fiv[k])==x)
            i*=-1;
    //printf("%lli= (%lli)^5 - (%lli)^5=\n",x, i, k); //printf("%lli", (lli)pow(k,5)-(lli)pow(i,5));
    printf("%lli %lli",i, k);

    return 0;
}