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# (.NET Core 3.1.201) (judge verdict: Wrong Answer)

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO.Pipes;
using System.Runtime;
 
namespace Csharponly
{
    class Program
    {
        static public void Main()
        {
        	long X = Oneint();
        	long[] num = new long[200];
        	for(int i = 0; i < 103; i++)
        	{
            	num[i] = i;
            	for(int j = 0; j < 4; j++)
            	{
            	    num[i] = num[i]*i;
            	}
        	}

        	long a = 0;
        	long b = 0;

        	for(int i = 0; i < 103; i++)
        	{	
            	for(int j = 0; j < i + 1; j++)
     	      	{
            	    if(num[i] - num[j] == X)
            	    {
        	            a = i;
   		               	b = j;
                	    i = 103;
            	        j = 103;
        	        }
        	        else if(num[i] + num[j] == X && j%2 == 1)
        	        {
        	            a = i;
   		               	b = -j;
                	    i = 103;
            	        j = 103;
        	        }
      	 	    }            
        	}
            Console.WriteLine(a + " " + b);
        }
 
      	static string Kakeru(string a1, string b1)
        {
            int anum = a1.Length;
            int bnum = b1.Length;
            int[] a = Array(a1);
            int[] b = Array(b1);
 
            int[] kakeruans = new int[anum + bnum];
            for(int i = 0; i < anum; i++)
            {
                for(int j = 0; j < bnum; j++)
                {
                    kakeruans[i + j] += a[i] * b[j];
                }
            }
            for(int i = 0; i < kakeruans.Length; i++)
            {
                if(kakeruans[i] >= 10)
                {
                    kakeruans[i + 1] += kakeruans[i] / 10;
                    kakeruans[i] = kakeruans[i] % 10;
                }
            }
            string kakerustring = "";
            for (int i = 0; i < kakeruans.Length - 1; i++)
            {
                kakerustring = kakeruans[i].ToString() + kakerustring;
            }
            if (kakeruans[kakeruans.Length - 1] != 0)
            {
                kakerustring = kakeruans[kakeruans.Length - 1].ToString() + kakerustring;
            }
 
            return kakerustring;
        }
 
    static string Tasu(string a1, string b1)
        {
            int anum = a1.Length;
            int bnum = b1.Length;
            int[] a = Array(a1);
            int[] b = Array(b1);
 
            string tasustring = "";
            if (anum < bnum)
            {
                int[] tasuans = new int[bnum + 1];
                for (int i = 0; i < anum; i++)
                {
                    tasuans[i] = a[i] + b[i];
                }
                for(int i = anum; i < bnum; i++)
                {
                    tasuans[i] = b[i];
                }
                for(int i = 0; i < tasuans.Length; i++)
                {
                    if(tasuans[i] >= 10)
                    {
                        tasuans[i] -= 10;
                        tasuans[i + 1]++; 
                    }
                }
                for (int i = 0; i < tasuans.Length - 1; i++)
                {
                    tasustring = tasuans[i].ToString() + tasustring;
                }
                if(tasuans[tasuans.Length - 1] != 0)
                {
                    tasustring = tasuans[tasuans.Length - 1].ToString() + tasustring;
                }
            }
            else
            {
                int[] tasuans = new int[anum + 1];
                for (int i = 0; i < bnum; i++)
                {
                    tasuans[i] = a[i] + b[i];
                }
                for (int i = bnum; i < anum; i++)
                {
                    tasuans[i] = a[i];
                }
                for (int i = 0; i < tasuans.Length; i++)
                {
                    if (tasuans[i] >= 10)
                    {
                        tasuans[i] -= 10;
                        tasuans[i + 1]++;
                    }
                }
                for (int i = 0; i < tasuans.Length - 1 ; i++)
                {
                    tasustring = tasuans[i].ToString() + tasustring;
                }
                if (tasuans[tasuans.Length - 1] != 0)
                {
                    tasustring = tasuans[tasuans.Length - 1].ToString() + tasustring;
                }               
            }
            return tasustring;
        }
 
    static int[] Array(string A)
        {
            int[] a = new int[A.Length];
            string num;
            for (int i = 0; i < A.Length; i++)
            {
                num = A.Substring(i, 1);
                a[A.Length - i - 1] = int.Parse(num);
            }
 
            return a;
        }
      
　　　　//一つの文字列を受け渡す
        static string Onestring()
        {
            return Console.ReadLine();
        }
 
        //複数の文字列を配列で受け渡す
        //文字列と文字列の間は" "で区切る
        static string[] Arraystring()
        {
            return Console.ReadLine().Split(' ');
        }
 
        //一つの数字を受け渡す
        static int Oneint()
        {
            return int.Parse(Console.ReadLine());
        }
 
        //複数の数字を配列で受け渡す
        //数字と数字の間は" "で区切る
        static int[] Arrayint()
        {
            String[] input_line = Console.ReadLine().Split(' ');
            int[] input_num = new int[input_line.Length];
            for (int i = 0; i < input_line.Length; i++)
            {
                input_num[i] = int.Parse(input_line[i]);
            }
            return input_num;
        }
    }
}