小细节多
读题要认真
注意是连续的段
思路较简单
include
using namespace std;
int main() {
int n,k,t;
int i,j;
scanf("%d%d%d",&n,&k,&t);
int x1,y1,x2,y2;
int x3,y3;
int cnt2=0,cnt3=0,cnt4=0;
int maxm=0;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
for(i=0;i<n;i++){
cnt4=0;
maxm=0;
for(j=0;j<t;j++){
scanf("%d%d",&x3,&y3);
if(x3>=x1&&y3<=y2&&x3<=x2&&y3>=y1) {
cnt4++;
if(cnt4>maxm) maxm=cnt4;
}
else cnt4=0;
}
if(maxm>=k) cnt2++;
if (maxm) cnt3++;
}
printf("%d\n%d",cnt3,cnt2);
}