Saturday, April 23, 2016

1107 - How Cow

Problem linkhttp://www.lightoj.com/volume_showproblem.php?problem=1107

Solve :

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t,x1,y1,x2,y2,x,y,n,i=1;
    scanf("%d",&t);

    while(t--)
    {
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        scanf("%d",&n);
        printf("Case %d:\n",i);
        i++;
        while(n--)
        {
            scanf("%d%d",&x,&y);


            if(x>x1 and x<x2 and y>y1 and y<y2)
            {
                printf("Yes\n");
            }
            else printf("No\n");
        }

    }

}

No comments:

Post a Comment