#include #include #include #include #include #include #define REP(i,j,N) for(int i=j,__i=N;i<__i;++i) struct Point{ double x; double y; Point(double x_=0,double y_=0){ x=x_; y=y_; } Point(const Point &dst){ x=dst.x; y=dst.y; } const std::string str()const{ std::ostringstream osm; char buf[128]; sprintf(buf,"%.16f",x); osm<<"("<>N; return true; } double getk(Point &left,Point &right){ double k=left.y; return left.y+(0-left.x)*(right.y-left.y)/(right.x-left.x); } int solve(){ using namespace std; vector points(N),tmp(3); Point point,left; double k1,k2; int count=0; REP(i,0,2) cin>>points[i].x>>points[i].y; REP(i,2,N){ cin>>points[i].x>>points[i].y; REP(j,0,i-1){ tmp[0]=points[j]; tmp[1]=points[j+1]; tmp[2]=points[i]; sort(tmp.begin(),tmp.end()); if(tmp[0].x<=0&&tmp[2].x>=0){ k1=getk(tmp[0],tmp[1]); k2=getk(tmp[0],tmp[2]); if((k1!=0&&k2!=0)&&((k1>0)^(k2>0))) { count++; //cout<