#include #include #include #include using namespace std; int dist(array x) { x[0] -= 144; x[1] -= 84; return x[0] * x[0] + x[1] * x[1]; } array solve() { array ret = {0, 0}; vector> pts; for(int i = 0; i < 2; i++) { int k; cin >> k; while(k--) { array pt = {0, 0, i}; cin >> pt[0] >> pt[1]; pts.push_back(pt); } } if(pts.size() == 0) return ret; sort(pts.begin(), pts.end(), [&](auto a, auto b) -> bool { return dist(a) < dist(b); }); int lhs = pts[0][2]; for(auto [_, __, idx]: pts) { if(lhs != idx) break; ret[lhs]++; } return ret; } int main() { array ret = {0, 0}; for(int i = 0; i < 10; i++) { array cand = solve(); ret[0] += cand[0]; ret[1] += cand[1]; } cout << ret[0] << " " << ret[1] << "\n"; }