-
Notifications
You must be signed in to change notification settings - Fork 0
/
202009-2.cpp
58 lines (54 loc) · 1.25 KB
/
202009-2.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include<iostream>
#include<algorithm>
using namespace std;
/*
(xr, yd) (xr, yu)
(xl,yd) (xl, yu)
*/
int n, k, t;
int xl, yd, xr, yu;
bool isIn(int x, int y)
{
if(x < xl || x > xr) return false;
if(y < yd || y > yu) return false;
return true;
}
int main()
{
cin >> n >> k >> t;
cin >> xl >> yd >> xr >> yu;
int pass = 0, stop = 0;
for(int i = 0; i < n; i++) {
int incnt = 0, concnt = 0;
bool flag = false;
bool inflag = false;
for(int j = 0; j < t; j++) {
int x, y;
cin >> x >> y;
if(isIn(x, y)) {
incnt++;
concnt++;
}else{
if(concnt >= k && flag == false){
stop++;
flag = true;
}
if(concnt < k && concnt > 0 && inflag == false) {
inflag = true;
}
concnt = 0;
}
}
if(concnt >= k && flag == false){
stop++;
flag = true;
}
if(incnt > 0 && inflag == false) {
inflag = true;
}
if(inflag) pass++;
}
cout << pass << endl;
cout << stop;
return 0;
}