CodeForces-1058B B. Vasya and Cornfield

在这里插入图片描述
在这里插入图片描述
这题,我真的不知道题解是啥,自己看代码吧。

#include<iostream>
using namespace std;
int main()
{
    int n, d,m,i,x,y;
    cin>>n>>d>>m;
    for(i=1;i<=m;i++)
    {
        cin>>x>>y;
        if(x+y-d>=0&&x+y+d-2*n<=0&&x-y-d<=0&&x-y+d>=0)
            cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}
原文地址:https://www.cnblogs.com/lunatic-talent/p/12798901.html