LightOJ 1107 Solution

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x1, y1, x2, y2, t, a, b, i = 1, n;
    cin >> t;
    while(t--)
    {
        cin >> x1 >> y1 >> x2 >> y2 >> n;
        cout << "Case " << i++ << ":\n";
        while(n--)
        {
            cin >> a >> b;
            if((a >= x1 && a <= x2) && (b >= y1 && b <= y2))
                cout << "Yes" << "\n";
            else
                cout << "No" << "\n";
        }
    }

    return 0;
}

Comments