Tuesday, July 28, 2015

1107 - How Cow

#include<bits/stdc++.h>
using namespace std;
 
int main()
{
    int T,x1,y1,x2,y2,M,x[105],y[105],i,c=1;
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&M);
        for(i=0;i<M;i++)
            scanf("%d%d",&x[i],&y[i]);
        printf("Case %d:\n",c++);
        for(i=0;i<M;i++)
        {
            if(x[i]>x1&&x[i]<x2 && y[i]>y1&&y[i]<y2)
                printf("Yes\n");
            else
                printf("No\n");
        }
    }
    return 0;
}

No comments:

Post a Comment

Triathlon

Triathlon - CodeChef # include < bits/stdc++.h > using namespace std ; # define fi first # define se second # define mp ...