atcoder#ABC197D. [ABC197D] Opposite
[ABC197D] Opposite
Score : points
Problem Statement
On a two-dimensional coordinate plane where the axis points to the right and the axis points up, we have a regular -gon with vertices . Here, is guaranteed to be even, and the vertices are in counter-clockwise order. Let denotes the coordinates of . Given , , , and , find and .
Constraints
- is even.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print and in this order, with a space in between. Your output is considered correct when, for each value printed, the absolute or relative error from our answer is at most .
4
1 1
2 2
2.00000000000 1.00000000000
We are given and . The fact that , , , and form a square and they are in counter-clockwise order uniquely determines the coordinates of the other vertices, as follows:
6
5 3
7 4
5.93301270189 2.38397459622