Pagini recente » Cod sursa (job #3305546) | Cod sursa (job #3307212) | Cod sursa (job #598711) | Cod sursa (job #12790) | Cod sursa (job #3305548)
#include<cstdio>
#include <vector>
using namespace std;
struct Point {
int x,y;
Point(int x,int y) {
this->x = x;
this->y = y;
}
bool Inside(int x1,int y1,int x2,int y2) {
return (this->x >= x1 && this->x <= x2 &&
this->y >= y1 && this->y <= y2);
}
};
vector<Point> points;
int main() {
freopen("zoo.in", "r", stdin);
freopen("zoo.out", "w", stdout);
int n,m,i;
scanf("%d",&n);
for (i=0;i<n;i++) {
int x,y;
scanf("%d %d",&x,&y);
Point p(x,y);
points.push_back(p);
}
scanf("%d",&m);
for (i=0;i<m;i++) {
int x1,y1,x2,y2;
scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
int cnt = 0;
for (auto point:points) {
cnt+=point.Inside(x1,y1,x2,y2);
}
printf("%d\n",cnt);
}
return 0;
}