#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
const int N=1e5+5;
const double eps=1e-8;
double ans=1e60;
struct Vector{
double x,y;
Vector(double x=0,double y=0):x(x),y(y){}
}p[N],q[N],t[5];int n,top;
Vector operator + (Vector A,Vector B){return Vector(A.x+B.x,A.y+B.y);}
Vector operator - (Vector A,Vector B){return Vector(A.x-B.x,A.y-B.y);}
Vector operator * (Vector A,double p){return Vector(A.x*p,A.y*p);}
Vector operator / (Vector A,double p){return Vector(A.x/p,A.y/p);}
double operator * (Vector A,Vector B){return A.x*B.y-A.y*B.x;;}
double operator / (Vector A,Vector B){return A.x*B.x+A.y*B.y;;}
bool operator<(Vector a,Vector b){
return fabs(a.y-b.y)<eps?a.x<b.x:a.y<b.y;
}
bool operator==(Vector a,Vector b){
return fabs(a.x-b.x)<eps&&fabs(a.y-b.y)<eps;
}
double Dot(Vector A,Vector B){return A.x*B.x+A.y*B.y;}
double Length(Vector A){return sqrt(Dot(A,A));}
double Angle(Vector A,Vector B){return acos(Dot(A,B)/(Length(A)*Length(B)));}
double Cross(Vector A,Vector B){return A.x*B.y-A.y*B.x;}
double Area2(Vector A,Vector B,Vector C){return Cross(B-A,C-A);}
bool cmp(Vector a,Vector b){
double t=(a-p[1])*(b-p[1]);
if(fabs(t)<eps) return Length(p[1]-a)-Length(p[1]-b)<0;
else return t>0;
}
void graham(){//凸包
for(int i=2;i<=n;i++) if(p[i]<p[1]) swap(p[i],p[1]);
sort(p+2,p+n+1,cmp);
q[++top]=p[1];
for(int i=2;i<=n;i++){
while(top>1&&(q[top]-q[top-1])*(p[i]-q[top])<eps) top--;
q[++top]=p[i];
}
q[0]=q[top];
}
void RC(){//旋转卡壳
int l=1,r=1,p=1;
double L,R,D,H;
for(int i=0;i<top;i++){
D=Length(q[i]-q[i+1]);
while((q[i+1]-q[i])*(q[p+1]-q[i])-(q[i+1]-q[i])*(q[p]-q[i])>-eps) p=(p+1)%top;
while((q[i+1]-q[i])/(q[r+1]-q[i])-(q[i+1]-q[i])/(q[r]-q[i])>-eps) r=(r+1)%top;
if(i==0) l=r;
while((q[i+1]-q[i])/(q[l+1]-q[i])-(q[i+1]-q[i])/(q[l]-q[i])<eps) l=(l+1)%top;
L=(q[i+1]-q[i])/(q[l]-q[i])/D,R=(q[i+1]-q[i])/(q[r]-q[i])/D;
H=(q[i+1]-q[i])*(q[p]-q[i])/D;
if(H<0) H=-H;
double tmp=(R-L)*H;
if(tmp<ans){
ans=tmp;
t[0]=q[i]+(q[i+1]-q[i])*(R/D);
t[1]=t[0]+(q[r]-t[0])*(H/Length(t[0]-q[r]));
t[2]=t[1]-(t[0]-q[i])*((R-L)/Length(q[i]-t[0]));
t[3]=t[2]-(t[1]-t[0]);
}
}
}
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%lf%lf",&p[i].x,&p[i].y);
graham();
RC();
printf("%.5lf\n",ans);
int fir=0;
for(int i=1;i<4;i++) if(t[i]<t[fir]) fir=i;
for(int i=0;i<4;i++){//某些OJ评测卡精度.. 比如,洛谷
if(fabs(t[(i+fir)%4].x)<1e-6) printf("0.00000 ");else printf("%.5lf ",t[(i+fir)%4].x);
if(fabs(t[(i+fir)%4].y)<1e-6) printf("0.00000\n");else printf("%.5lf\n",t[(i+fir)%4].y);
}
return 0;
}
/*
Sample Input
6
1.0 3.00000
1 4.00000
2.00000 1
3 0.00000
3.00000 6
6.0 3.0
Sample Output
18.00000
3.00000 0.00000
6.00000 3.00000
3.00000 6.00000
0.00000 3.00000
*/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术