Get Closer

AtCoder
IDabc246_b
Time2000ms
Memory256MB
Difficulty
From the point $(0,0)$ in a two-dimensional plane, let us move the distance of $1$ toward the point $(A, B)$. Find our coordinates after the move. Here, after moving the distance of $d$ from a point $X$ to a point $Y$ ($d \le$ length of the segment $XY$), we are at the point on the segment $XY$ whose distance from $X$ is $d$. The Constraints guarantee that the distance between the points $(0, 0)$ and $(A, B)$ is at least $1$. ## Constraints * All values in input are integers. * $0 \le A,B \le 1000$ * $(A,B) \neq (0,0)$ ## Input Input is given from Standard Input in the following format: $A$ $B$ [samples]
Samples
Input #1
3 4
Output #1
0.600000000000 0.800000000000

Printing `0.5999999999 0.8000000001`, for example, would also be accepted.
Input #2
1 0
Output #2
1.000000000000 0.000000000000

We may arrive at $(A, B)$.
Input #3
246 402
Output #3
0.521964870245 0.852966983083
API Response (JSON)
{
  "problem": {
    "name": "Get Closer",
    "description": {
      "content": "From the point $(0,0)$ in a two-dimensional plane, let us move the distance of $1$ toward the point $(A, B)$. Find our coordinates after the move. Here, after moving the distance of $d$ from a point $",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc246_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "From the point $(0,0)$ in a two-dimensional plane, let us move the distance of $1$ toward the point $(A, B)$. Find our coordinates after the move.\nHere, after moving the distance of $d$ from a point $...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments