CCF 202009-2 风险人群筛查

380 字
1 分钟
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>

using namespace std;

int main()
{
    int n,k,t,xl,yd,xr,yu;
    int tg = 0,dl=0;
    cin >> n >> k >> t >> xl >> yd >> xr >>yu;
    for(int j = 0;j<n;j++) {
        int tmp1, tmp2, num = 0, judge = 0;
        for (int i = 0; i < t; i++) {
            cin >> tmp1 >> tmp2;
            if ((tmp1 >= xl && tmp1 <= xr) && (tmp2 >= yd && tmp2 <= yu)) {
                if (judge == 0) {
                    tg++;
                }
                if(judge != 2) {
                    num++, judge = 1;
                }
            } else {
                num = 0;
            }
            if (num >= k && judge ==1) {
                dl++,judge = 2;
            }
        }
    }
    cout << tg << endl;
    cout << dl <<endl;
    return 0;
}