LCC/Moose '19 Contest 3 J1 - Discrete Pinwheel

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

hewmatt10 is playing with a pinwheel! As the wind blows, the pinwheel spins. However, this type of pinwheel is special. It can only rotate in multiples of 90 degrees! Given the coordinates of one of the blades, can you find the new coordinates after a rotation?

Input Specification

The first line will contain the coordinates of the blade, x, y. x and y are integers. The second line will contain the size of a counterclockwise rotation in degrees, d, a non-negative multiple of 90 less than 360.

Output Specification

Output the coordinates of the blade on the same line, after a counterclockwise rotation by d degrees.

Subtasks

Subtask 1 [50%]

(-10^9 \le x, y \le 10^9)

Subtask 2 [50%]

(-10^{18} \le x, y \le 10^{18})

Sample Input

1 3
90

Sample Output

-3 1

Comments

There are no comments at the moment.