//Simplest Task in Windows
http://acm.zju.edu.cn/show_problem.php?pid=2480
//2008.5.15 20:36:21 Accepted 2480 C++ 00:00.00 836K 天将降大任于我
// Please notice that windows may overlap, and the window on top would
//receive the click rather than others 窗口会叠加,并且在顶部的窗口接受点击的几率比其他的还要大
// The windows are given in back-to-front order 窗口是从底到顶地给出的
#include<iostream>
using namespace std;
struct node
{
int x1,y1,x2,y2;
}a[11];
int main()
{
int i,n,j,k;int b[51][2];
while(scanf("%d",&n)&&n)
{
for(i=0;i<n;i++)
scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
scanf("%d",&k);
for(i=0;i<k;i++) scanf("%d%d",&b[i][0],&b[i][1]);
for(i=0;i<k;i++)
{ for(j=n-1;j>=0;j--)
{
if(b[i][0]>=a[j].x1&&b[i][0]<=a[j].x2&&b[i][1]>=a[j].y1&&b[i][1]<=a[j].y2) {printf("%d\n",j);break;}
}
if(j<0) printf("-1\n");
}
}
return 0;
}
心难泰,世风坏,旧时正气今何在?正义寡,人情薄,闻道虽多,茅塞不开。怪!怪!怪!
空等待,几多载,冲出重围人心快!暴雨打,狂风袭,任他折磨,此志难改。耐!耐!耐!