eolymp
bolt
Try our new interface for solving problems
Problems

Lie to me

Lie to me

--- \textit{Nothing personal, but I don't believe in your ways of cutting the cake. } --- \textit{You'd better believed. } --- \textit{Than prove it. } --- \textit{I'm not so cool, but my notebook never lies to me. } --- \textit{I can't see a backpack on you. } --- \textit{Damn it, haven't I taken it?.. Joke, surely I have.} Reminding that the cake cutting plan contains the following information: The cake is represented as regular \textbf{N}-gon with center at point \textbf{(0, 0)} and one of the vertices at point \textbf{(1, 0)}. Whole cake is cut into \textbf{N+1} pieces. Each of those pieces is convex polygons. Check if all the pieces are convex polygons without three vertices on one line, in counterclockwise pass order. Check if all the pieces have equal square. Check if all the pieces have equal length of the outer border, i.e. the part of the border that reproduces the initial cake border. Check if is possible to join all the pieces together, so they will form the full cake. \InputFile In the first line is given number \textbf{N} (\textbf{3} ≤ \textbf{N} ≤ \textbf{100}) --- number of the cake vertices. Then the description of \textbf{N+1} pieces is given. The description of one piece is started with number \textbf{K_i} (\textbf{3} ≤ \textbf{K_i} ≤ \textbf{100}) --- number of the vertices in the piece. Next \textbf{K_i} number of the vertices in the piece. Next lines contain those vertices listed in random order, given by two coordinates \textbf{x_i} and \textbf{y_i} (\textbf{-100} ≤ \textbf{x_i}, \textbf{y_i} ≤ \textbf{100}). Àll the coordiantes are real numbers with not more than \textbf{15} decimal places. \OutputFile Print "\textbf{Yes}", in case the description matches the correct cake cutting, otherwise --- "\textbf{No}". It's guaranteed that in case the answer is"\textbf{No}" parameters which provide this answer are not less than \textbf{10^\{-6\}}.
Time limit 1 second
Memory limit 256 MiB
Input example #1
3
3
0.000000000000 0.000000000000
1.000000000000 0.000000000000
-0.125000000000 0.649519052838
4
0.000000000000 0.000000000000
-0.125000000000 0.649519052838
-0.500000000000 0.866025403784
-0.500000000000 0.000000000000
4
0.000000000000 0.000000000000
-0.500000000000 0.000000000000
-0.500000000000 -0.866025403784
-0.125000000000 -0.649519052838
3
0.000000000000 0.000000000000
-0.125000000000 -0.649519052838
1.000000000000 -0.000000000000
Output example #1
Yes