Author: | A. Baranov | Time limit: | 1 sec | |
Input file: | Standard input | Memory limit: | 256 Mb | |
Output file: | Standard output |
There are two simple (without self-intersections) polygons, each represented by a sequence of vertices in either clockwise or counter-clockwise order.
Your program must determine whether the polygons are similar, that is, whether one of them can be transformed into another by applying zero or more of the following operations:
Input contains integer n, followed by 2 ⋅ n vertices (first one polygon, then another), represented by pairs of integers: (xi, yi).
Output must contain a single integer: 1, if polygons are similar, 0 otherwise.
It is guaranteed that both polygons are non-degenerate, i.e. have an area strictly greater than zero.
All edges also have non-zero length.
− 104 ≤ (xi, yi) ≤ 104, 3 ≤ n ≤ 105
No. | Standard input | Standard output |
---|---|---|
1 |
|
|
2 |
|
|