#A. Moving Towards a Point

    Type: Default 1000ms 256MiB

Moving Towards a Point

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Problem Statement

You are currently at the origin (0,0)(0, 0) in a two-dimensional plane and you need to move a distance of 11 unit towards the point (A,B)(A, B). Your task is to find your coordinates after the move.

Here, moving a distance dd from a point XX to a point YY (dd \leq length of the segment XYXY), places you at the point on the segment XYXY whose distance from XX is dd. The constraints guarantee that the distance between the points (0,0)(0, 0) and (A,B)(A, B) is at least 11.

INPUT FORMAT (input arrives from the terminal / stdin):

The first line of the input contains two integers AA and BB, the coordinates of the point you are moving towards. It is guaranteed that (A,B)(0,0)(A, B) \neq (0, 0).

OUTPUT FORMAT (print output to the terminal / stdout):

Print two numbers xx and yy, your coordinates after the move. They should be printed in this order, separated by a space.

Your output is considered correct when, for each printed value, the absolute or relative error from the judge's answer is at most 10610^{-6}.

SAMPLE INPUT 1:

3 4

SAMPLE OUTPUT 1:

0.600000000000 0.800000000000

If you print 0.5999999999 0.8000000001, for example, would also be accepted.

SAMPLE INPUT 2:

246 402

SAMPLE OUTPUT 2:

0.521964870245 0.852966983083

If you print 0.5999999999 0.8000000001, for example, would also be accepted.

SCORING:

  • For all inputs: 0A,B10000 \leq A, B \leq 1000

HFI Coding Club 2023 November Contest

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2023-11-16 18:45
End at
2023-11-16 20:45
Duration
2 hour(s)
Host
Partic.
21