luogu#P7000. [NEERC2013] Easy Geometry
[NEERC2013] 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 -- the number of sides of the polygon . The following lines contain Cartesian coordinates of the polygon's vertices -- two integers and per line. Vertices are given in the clockwise order.
The polygon is convex.
输出格式
Output four real numbers and -- the coordinates of two rectangle's corners The rectangle must fit into the polygon and have the maximum possible area.
The absolute precision of the coordinates should be at least
The absolute or relative precision of the rectangle area should be at least That is, if ; is the actual maximum possible area, the following must hold:
题目大意
一句话题意:
给你一个凸 边形,并按顺时针给出每一个顶点的坐标,求出在这个凸 边形之内的面积最大的一个边平行坐标轴的矩形的四个顶点。
输入格式:
第一行是一个正整数 ,且 。
接下来 行,每行两个整数 , ,代表一个顶点的 坐标和 坐标。 。
输出格式:
输出四个整数 ,代表你给出的这个面积最大的矩形。其中 , 。
精度要求:如果 是你算出的值, 是真实的最大面积,那么你需要保证 。
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.