logo AlgoBeat OnlineJudge
登录 注册

#212932. [NERC 2020 Online] New Flat

内存限制:512 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 representing the flat and a segment inside the polygon representing the couch. We say that couch can position if there are 2 continuous functions and from to the inside or the boundary of such that and for . Your task is to find the maximal possible value of the angle between the lines and for all the reachable positions . The angle between lines is defined as the minimum of two angles at the point of intersection, or if lines are parallel.

输入格式

The first line of the input contains five integers , , , , and (; , ) --- the number of vertices in and the coordinates of the ends of the couch.

The next lines contain two integers and each () --- the coordinates of the polygon vertices in counter-clockwise order.

It is guaranteed that both and are either inside or on the boundary of 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 .

样例

样例输入 1

6 2 1 -2 1
2 1
0 3
-2 1
-2 -1
0 -3
2 -1

样例输出 1

90

样例输入 2

4 -1 -1 1 0
1 1
-1 1
-1 -1
1 -1

样例输出 2

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.