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 Rust (1.42.0) (judge verdict: Wrong Answer)

fn main() {
    let s = read_line();
    let x: i64 = read_num_vec(s, 1).get(0).unwrap().to_owned();

    let mut candidate_vec = vec![];
    for i in -100 as i64..101 {
        candidate_vec.push(i.pow(5));
    }
    let mut a: i64 = -999;
    let mut b: i64 = -999;

    for (b_index, candidate) in candidate_vec.to_vec().iter().enumerate() {
        let mut r = x - 1;
        let mut q = 0;
        if *candidate != 0 {
            r = x / candidate;
            q = x % candidate;
        }
        if q == 0 && candidate_vec.contains(&(r + 1)) {
            b = b_index as i64 - 100;
            for (a_index, a_pow) in candidate_vec.to_vec().iter().enumerate() {
                if *a_pow == r + 1 {
                    let ab = a_index as i64 - 100;
                    a = ab * b;
                    break;
                }
            }
            if a != -999 {
                break;
            }
        }
    }

    println!("{} {}", a, b);
}

fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim_end().to_owned()
}

fn read_num_vec(s: String, length: usize) -> Vec<i64> {
    let mut ws = s.split_whitespace();
    let mut result = vec![];
    for _ in 0..length {
        result.push(ws.next().unwrap().parse().unwrap());
    }
    result
}