#include <iostream> #include <bits/stdc++.h> #include <string> using namespace std; typedef struct { int x;int y; }XY; XY xy1,xy2; int k;//阈值 int across=0,stay=0; bool inOrout(XY user) { //if(xy1.x<=user.x&&user.x<=xy2.x // &&xy1.y<=user.y&&user.y<=xy2.y) // printf("in\n"); return(xy1.x<=user.x&&user.x<=xy2.x &&xy1.y<=user.y&&user.y<=xy2.y); } void accumu(vector<XY> xy) { bool flag0=false,flag1=false,flaglast; int constant=1; for(int i=0;i<xy.size();i++) { // printf("%d\n",constant); bool temp=inOrout(xy[i]); if(i==0) { if(temp) flaglast=true; else flaglast=false; } if(temp&&flag0==false) { flag0=true; } if(temp&&flaglast) constant++; if(temp&&i!=xy.size()-1) flaglast=true; else{ flaglast=false; if(constant>=k){ flag1=true; break; }else{ constant=1; } } } if(flag0==true) across++; if(flag1==true) stay++; return; } int main() { int number; int t;//t个坐标 cin>>number>>k>>t>>xy1.x>>xy1.y>>xy2.x>>xy2.y; while(number--) { vector<XY> xy; XY temp; for(int i=0;i<t;i++) { cin>>temp.x>>temp.y; xy.push_back(temp); } accumu(xy); } if(k!=1) cout<<across<<endl<<stay<<endl; else cout<<across<<endl<<across<<endl; }