I hate Factorization

AtCoder
IDabc166_d
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
33
Output #1
2 -1

For $A=2$ and $B=-1$, $A^5-B^5 = 33$.
Input #2
1
Output #2
0 -1
API Response (JSON)
{
  "problem": {
    "name": "I hate Factorization",
    "description": {
      "content": "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$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc166_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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$.\n\n## Constraints\n\n*   $1 \\leq X \\leq 10^9$\n*   $X$ is an integer.\n*  ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments