~/algor $ cat problems/qidiruv-kub-tenglama
Solving a cubic equation
Easy
1000 ms
128 MB
30%
A positive integer $c$ is given. Find a positive integer $x$ satisfying $x^{3} + x = c$. If there is no such number, print $-1$.
Input
One positive integer $c$.
Output
One integer — $x$ or $-1$.
Note
$1 \le c \le 10^{18}$
Examples
Input #1
30
Output #1
3
Input #2
20
Output #2
-1