initial code
This commit is contained in:
parent
29d44cde63
commit
2b89ccf866
36
1848A Vika and Her Friends/1848A.cpp
Normal file
36
1848A Vika and Her Friends/1848A.cpp
Normal 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user