S = 1

AtCoder
IDabc340_f
Time2000ms
Memory256MB
Difficulty
You are given integers $X$ and $Y$, which satisfy at least one of $X \neq 0$ and $Y \neq 0$. Find a pair of integers $(A, B)$ that satisfies all of the following conditions. If no such pair exists, report so. * $-10^{18} \leq A, B \leq 10^{18}$ * The area of the triangle with vertices at points $(0, 0), (X, Y), (A, B)$ on the $xy$\-plane is $1$. ## Constraints * $-10^{17} \leq X, Y \leq 10^{17}$ * $(X, Y) \neq (0, 0)$ * $X$ and $Y$ are integers. ## Input The input is given from Standard Input in the following format: $X$ $Y$ [samples]
Samples
Input #1
3 5
Output #1
1 1

The area of the triangle with vertices at points $(0, 0), (3, 5), (1, 1)$ is $1$. Thus, $(A, B) = (1, 1)$ satisfies the conditions.
Input #2
\-2 0
Output #2
0 1
Input #3
8752654402832944 -6857065241301125
Output #3
\-1
API Response (JSON)
{
  "problem": {
    "name": "S = 1",
    "description": {
      "content": "You are given integers $X$ and $Y$, which satisfy at least one of $X \\neq 0$ and $Y \\neq 0$.   Find a pair of integers $(A, B)$ that satisfies all of the following conditions. If no such pair exists, ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc340_f"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given integers $X$ and $Y$, which satisfy at least one of $X \\neq 0$ and $Y \\neq 0$.  \nFind a pair of integers $(A, B)$ that satisfies all of the following conditions. If no such pair exists, ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments