func_code_string: #include <bits/stdc++.h>   using namespace std;   struct Point {     long long x, y;     int type;     void get(int t) {       cin >> x >> y;       type = t;     }   };   int N, M;   Point R[500], B[500], P[1000], pivot;   bool used[500];   Point operator-(Point p1, Point p2) { return Point{p1.x - p2.x, p1.y - p2.y}; }   int quadrant(Point p) {     if (p.x >= 0 && p.y >= 0) return 1;     if (p.x <= 0 && p.y >= 0) return 2;     if (p.x <= 0 && p.y <= 0) return 3;     return 4;   }   long long cross(Point p1, Point p2) { return p1.x * p2.y - p1.y * p2.x; }   bool operator<(Point p1, Point p2) {     if (quadrant(p1 - pivot) != quadrant(p2 - pivot))       return quadrant(p1 - pivot) < quadrant(p2 - pivot);     return cross(p1 - pivot, p2 - pivot) > 0;   }   int main() {     while (cin >> N >> M) {       for (int i = 0; i < N; i++) R[i].get(0);       for (int i = 0; i < M; i++) B[i].get(1);       memset(used, 0, sizeof(used));       int x = 0;       for (int i = 0; i < N; i++) {         used[i] = 1;         pivot = R[i];         int cnt = 0;         for (int j = 0; j < N; j++)           if (!used[j]) P[cnt++] = R[j];         for (int j = 0; j < M; j++) P[cnt++] = B[j];         sort(P, P + cnt);         for (int j = 0; j < cnt; j++) {           if (P[j].type == 0) {             int last = -1;             for (int k = (j + 1) % cnt; k != j; k = (k + 1) % cnt) {               bool ok = (last == -1 || cross(P[last] - P[j], P[k] - P[j]) > 0);               if (P[k].type == 0) {                 if (cross(P[j] - R[i], P[k] - R[i]) < 0) break;                 if (ok) x++;               } else if (ok)                 last = k;             }           }         }       }       cout << x << endl;     }     return 0;   }   