Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- int n, m, k;
- cin>>n>>m>>k;
- int x, y;
- cin>>x>>y;
- int f = 1;
- for(int i=0; i<k; i++)
- {
- int a, b;
- cin>>a>>b;
- f &= ((x+y)%2 != (a+b)%2);
- }
- if(f) cout<<"YES\n";
- else cout<<"NO\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment