思路:独立地看第i个人,当且仅当(abs(x[i] - x) + abs(y[i] - y)) % 2 == 0, 第i个人才能抓到小A
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define lson p << 1
#define rson p << 1 | 1
const int maxn = 1e6 + 5, inf = 1e18, maxm = 4e4 + 5, mod = 1e9 + 7, N = 1e6;
int a[maxn], b[maxn];
// bool vis[maxn];
int n, m;
int vis[105][105] = {0};
string s;
void solve(){
int res = 0;
int q, k;
int x0, y0;
int x[105], y[105];
cin >> n >> m >> k;
cin >> x[0] >> y[0];
int cnt = 0;
for(int i = 1; i <= k; i++){
cin >> x[i] >> y[i];
int dx = abs(x[0] - x[i]);
int dy = abs(y[0] - y[i]);
if((dx + dy) % 2 == 0){
cnt++;
}
}
if(cnt >= 1){
cout << "No\n";
}
else cout << "Yes\n";
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
int T = 1;
cin >> T;
while (T--)
{
solve();
}
return 0;
}