← All problemsSign in

Rotate Point

CodeChefRating 2767Open on judge ↗

You are given n points p1, p2, ..., pn in a plane and n integers a1, a2, ..., an. For any index i (1 ≤ i ≤ n), it is possible to perform the following operation (let's call it i-rotation) on an arbitrary point P: Rotate P by ai degrees counter-clockwise around the point pi. Note that ai will always be a multiple of 90. Also note that such an operation changes the point P. You should process q q

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start