CF BUDDY
← Problems·

100I · Rotation

1500 · *special, geometry, math

Problem: Ehsan loves geometry! Especially he likes to rotate points!

Given a point in the plane, Ehsan likes to rotate it by k degrees (counter-clockwise), around the origin. What is the result of this rotation?

Input Format: A single integer k (0 ≤ k < 360) is given in the first line. Two integer numbers x and y are given in the second line ( - 1390 ≤ x, y ≤ 1390).

Output Format: Write two numbers. The result of the rotation. Your answer must have a relative error less than 10 - 1.

Sample Cases

Case 1

Input

90
1 1

Output

-1.00000000 1.00000000

Case 2

Input

180
1 1390

Output

-1.00000000 -1390.00000000

Similar problems

00:00:00
Loading editor…
Welcome! I'm your coding tutor for this problem. Use the chips below to reveal stored hints or get AI feedback on your code. I'll guide you step by step — never giving away the solution.

Sign in to unlock AI tutor feedback