// OBčh2009 Day3 I : Wind Passages #include #include #include using namespace std; const double EPS = 1e-7; typedef complex P; typedef vector

G; struct L { P p, q; L(P p, P q) : p(p), q(q) {} }; double dot(P a, P b) { return real(conj(a)*b); } double cross(P a, P b) { return imag(conj(a)*b); } double distLP(L l, P p){ if(dot(l.q-l.p,p-l.p)<-EPS) return abs(p-l.p); if(dot(l.p-l.q,p-l.q)<-EPS) return abs(p-l.q); return abs(cross(l.q-l.p,p-l.p))/abs(l.q-l.p); } double distLL(L l, L m){ double res = distLP(l, m.p); res = min(res, distLP(l, m.q)); res = min(res, distLP(m, l.p)); res = min(res, distLP(m, l.q)); return res; } double distCC(G g1, G g2){ double res = 1e12; for(int i=0;i> w >> n, w){ for(int i=0;i vg; G vd1, vd2; vd1.push_back(P(0,-100)); vd1.push_back(P(0,20000)); vd2.push_back(P(w,-100)); vd2.push_back(P(w,20000)); for(int i=0;i> m; for(int j=0;j> x >> y; g.push_back(P(x,y)); } vg.push_back(g); } for(int i=0;i