#P7000. [NEERC 2013] Easy Geometry

[NEERC 2013] Easy Geometry

题目描述

Eva studies geometry. The current topic is about convex polygons, but Eva prefers rectangles. Eva's workbook contains drawings of several convex polygons and she is curious what is the area of the maximum rectangle that fits inside each of them.

Help Eva! Given the convex polygon, find the rectangle of the maximum possible area that fits inside this polygon. Sides of the rectangle must be parallel to the coordinate axes.

输入格式

The first line contains a single integer nn -- the number of sides of the polygon (3n100000)(3 \le n \le 100 000) . The following nn lines contain Cartesian coordinates of the polygon's vertices -- two integers xix_{i} and yi(109xi,yi109)y_{i} (-10^{9} \le x_{i}, y_{i} \le 10^{9}) per line. Vertices are given in the clockwise order.

The polygon is convex.

输出格式

Output four real numbers xmin,ymin,xmaxx_{mi_n}, y_{mi_n}, x_{max} and ymaxy_{max} -- the coordinates of two rectangle's corners (xmin<xmax,ymin<ymax).(x_{mi_n} < x_{max}, y_{mi_n} < y_{max}). The rectangle must fit into the polygon and have the maximum possible area.

The absolute precision of the coordinates should be at least 105.10-^{5}.

The absolute or relative precision of the rectangle area should be at least 105.10^{-5}. That is, if AA' ; is the actual maximum possible area, the following must hold: min(AA,AA/A))105.mi_n(|A-A'|,|A−A'|/A') ) \le 10^{-5}.

4
5 1
2 4
3 7
7 3

3.5 2.5 5.5 4.5

5
1 1
1 4
4 7
7 4
7 1

1 1 7 4

提示

Time limit: 1 s, Memory limit: 128 MB.