### Codeforces Round #113 (Div. 2) B 判斷多邊形是否在凸包內

`int   cmp(double x){      if(fabs(x) < 1e-8)  return 0 ;      return  x > 0 ? 1 : -1 ;}struct  point{        double x , y ;        int k ;        point(){}        point(double _x , double _y):x(_x) , y(_y){}        point operator - (const point &o){              return  point(x - o.x , y - o.y) ;        }        friend double operator ^ (const point &a , const point &b){              return a.x * b.y - a.y * b.x ;        }        friend bool operator < (const point &a , const point &b){              if(cmp(a.x - b.x) != 0)  return cmp(a.x - b.x) < 0 ;              if(cmp(a.y - b.y) != 0)  return  cmp(a.y - b.y) < 0 ;              return  a.k < b.k ;        }        friend bool operator == (const point &a , const point &b){             return cmp(a.x - b.x) == 0 && cmp(a.y - b.y) == 0 ;        }};vector<point>  convex_hull(vector<point> a){       vector<point>  s(a.size() * 2 + 5) ;       sort(a.begin() , a.end()) ;       int m = 0  ;       for(int i = 0 ; i < a.size() ; i++){            while(m > 1 && cmp((s[m-1] - s[m-2]) ^ (a[i] - s[m-2])) < 0) m-- ;            s[m++] = a[i] ;       }       int k = m ;       for(int i = a.size() - 2 ; i >= 0 ; i--){            while(m > k && cmp((s[m-1] - s[m-2]) ^ (a[i] - s[m-2])) < 0) m-- ;            s[m++] = a[i] ;       }       s.resize(m) ;       if(a.size() > 1) s.resize(m-1) ;       return s ;}int   main(){      int i , n ,  m  , ans = 0  ;      vector<point> lis(200000) ;      cin>>n;      for(i = 0 ; i < n ; i++){          scanf("%lf%lf" , &lis[i].x , &lis[i].y) ;          lis[i].k = 0 ;      }      cin>>m ;      for(i = 0 ; i < m ; i++){          scanf("%lf%lf" , &lis[n+i].x , &lis[n+i].y) ;          lis[n+i].k = 1 ;      }      lis.resize(n + m)  ;      vector<point> hull = convex_hull(lis)  ;      for(i = 0 ; i < hull.size() ; i++){          if(hull[i].k){               ans = 1 ;               break  ;          }      }      printf("%s\n" , ans ? "NO" : "YES") ;      return  0 ;}`