#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,a1[10010],b1[10010],a2[10010],b2[10010],i,x,y;
cin>>n;
for(i=1;i<=n;i++)cin>>a1[i]>>b1[i]>>a2[i]>>b2[i];
cin>>x>>y;
for(i=n;i>=1;i--){
if(x>=a1[i]&&x<=a2[i]+a1[i]&&y>=b1[i]&&y<=b2[i]+b1[i]){
cout<<i<<endl;
return 0;
}
}
cout<<-1<<endl;
return 0;
}
时间: 2024-10-10 08:53:05