#include #include #include #include #include #include #include using namespace std; #define maxn 210 #define LL long long #define eps 1e-6 #define PI acos(-1.0) int n,m,tot; struct Point{ double x,y; Point(){} Point(double _x,double _y) { x=_x; y=_y; } }; bool operator < (const Point& a,const Point& b) { if(fabs(a.x-b.x)>eps) return a.xeps) return a.yg; vectorvp,p[maxn]; Line lines[maxn]; vectorE[maxn*maxn/2]; vectorans; Point pts[maxn]; bool check(double a,double b) { if(b>a+eps) return b+eps&E,double w) { double d=w+PI; if(d>PI+eps) d-=2*PI; int id; for(id=0;ideps) - (d<-eps); } double cross(const Point & o, const Point & a, const Point & b) { return (a.x-o.x)*(b.y-o.y) - (b.x-o.x)*(a.y-o.y); } int inside_convex(Point * ps, int n, Point q) { bool s[3] = {1, 1, 1}; ps[n] = ps[0]; for(int i = 0; i < n && (s[0] | s[2]); i ++) { s[ 1+sig(cross(ps[i+1], q, ps[i])) ] = 0; } if(s[0] | s[2]) return s[1]+1; return 0; } void init() { int i,j; for(i=0;i::iterator it=g.begin();it!=g.end();it++) { vp.push_back(it->first); it->second=tot; E[tot++].clear(); } for(i=0;i2*eps) ans++; } } printf("Number of regions=%d.\n",ans); } int main() { int ncase; scanf("%d",&ncase); while(ncase--) { scanf("%d %d",&n,&m); init(); gao(); } return 0; }