#P12863. [NERC 2020 Online] New Flat

    ID: 12641 Type: RemoteJudge 2000ms 512MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>2020Special JudgeICPCNERC/NEERC

[NERC 2020 Online] New Flat

题目描述

Flato lives in Flatburg, the capital of Flatland, and he just bought a new flat! His only problem is that while the movers brought in his favorite couch, they have put it in the wrong place. Now Flato wants to fix this by moving his couch, but it is pretty long. Can you help Flato?

As with all flats in Flatland, Flato's flat is a convex polygon. His favorite couch is infinitely thin, so we would represent it as a segment. Formally speaking, we have a polygon PP representing the flat and a segment ABAB inside the polygon representing the couch. We say that couch can reach\emph{reach} position CDCD if there are 2 continuous functions ff and gg from [0,1][0, 1] to the inside or the boundary of PP such that f(0)=A,f(1)=C,g(0)=B,g(1)=Df(0) = A, f(1) = C, g(0) = B, g(1) = D and f(x)g(x)=AB|f(x)g(x)| = |AB| for 0x10 \leq x \leq 1. Your task is to find the maximal possible value of the angle between the lines ABAB and CDCD for all the reachable positions CDCD. The angle between lines is defined as the minimum of two angles at the point of intersection, or 00 if lines are parallel.

输入格式

The first line of the input contains five integers nn, xAx_A, yAy_A, xBx_B, and yBy_B (3n503 \leq n \leq 50; 15000xA,yA-15\,000 \leq x_A, y_A, xB,yB15000x_B, y_B \leq 15\,000) --- the number of vertices in PP and the coordinates of the ends of the couch.

The next nn lines contain two integers xx and yy each (15000x,y15000-15\,000 \leq x, y \leq 15\,000) --- the coordinates of the polygon vertices in counter-clockwise order.

It is guaranteed that both AA and BB are either inside or on the boundary of PP and that the polygon is convex.

输出格式

Output the maximal angle in degrees as described in the problem statement. Your output will be considered correct if its absolute or relative error does not exceed 10610^{-6}.

6 2 1 -2 1
2 1
0 3
-2 1
-2 -1
0 -3
2 -1
90
4 -1 -1 1 0
1 1
-1 1
-1 -1
1 -1
36.86989764584401285674

提示

The angle between two lines is always between 0 and 90 degrees. Pictures for both samples with the initial and one of the possible final positions with the largest angle are shown below.