#include #include #include #include using namespace std; #define N 155 #define eps 1e-8 struct TPoint { double x,y; }s; struct TPolygon { int n; TPoint p[N]; }ply1,ply2,ans; double maxdist; int dblcmp(double a) {return a<-eps?-1:a>eps?1:0;} double MAX(double a,double b) {return a>b?a:b;} double cross(TPoint a,TPoint b,TPoint c) { return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x); } double plyarea(TPolygon res) { int i; double area=0; res.p[res.n]=res.p[0]; for(i=0;i=0) b.p[t++]=res.p[i]; if(d1*d2<0) { a.x=(s2*res.p[i].x-s1*res.p[i+1].x)/(s2-s1); a.y=(s2*res.p[i].y-s1*res.p[i+1].y)/(s2-s1); b.p[t++]=a; } } b.n=t; return b; } int main() { while(scanf("%d",&ply1.n),ply1.n) { int i; double sumarea,area; for(i=0;i