initial code

This commit is contained in:
ShazidMahsrafi 2023-07-17 00:42:23 +06:00
parent 29d44cde63
commit 2b89ccf866

View File

@ -0,0 +1,36 @@
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n,m,k;
cin>>n>>m>>k;
int x,y;
cin>>x>>y;
bool caught=false;
while(k--)
{
int p,q;
cin>>p>>q;
int d=abs(x-p)+abs(y-q);
if(d%2==0)
{
caught=true;
}
}
if(caught) cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
cin >> TC;
cin.ignore();
while (TC--) solve();
}