#include #include #include #include using namespace std; typedef long double ld; struct vec3{ ld x,y,z; vec3 operator-(vec3 const &a)const{return {x-a.x,y-a.y,z-a.z};} void fix(){ld l=hypotl(hypotl(x,y),z); x/=l,y/=l,z/=l;} ld dot(vec3 const &b)const{return x*b.x+y*b.y+z*b.z;} vec3 cross(vec3 const &b)const{return {y*b.z-z*b.y,z*b.x-x*b.z,x*b.y-y*b.x};} }; vector path(bool loop=false){ int n; cin>>n; vector res(n); for (auto &i: res){ ld lon,lat; cin>>lat>>lon; lon*=M_PI/180.L, lat*=M_PI/180.L; i={cos(lat)*sin(lon), sin(lat), cos(lat)*cos(lon)}; } if (loop) res.push_back(res.front()); return res; } vector> continents(){ int n; cin>>n; vector> res(n); for (auto &i: res) i=path(true); return res; } vector find_intersections(vec3 a, vec3 b, vector const &loop){ static vector res; res.clear(); for (int i=1; i when; ld len=0.L,frac=0.L; for (int i=1; i