#include using namespace std; using ll = long long; void solve(){ ll N, M; cin >> N >> M; vector A(N), B(M); vector r, b, p; for (int i=0; i> A[i]; for (int i=0; i> B[i]; map> mp; for (int i=0; i> T; while(T){ T--; solve(); } return 0; }