铺地毯


#include<iostream>
using namespace std;
int main()
{
int n, x1, y1;
cin >> n;
int a[10001], b[10001], x[10001], y[10001];
for (int i = 0; i < n; i++)
{
cin >> a[i] >> b[i];
cin >> x[i] >> y[i];
}
cin >> x1 >> y1;
for (int j = n - 1; j >= 0; j--)
{
if (x1 >= a[j] && x1 <= a[j] + x[j] && y1 >= b[j] && y1 <= b[j] + y[j])
{
cout << j + 1 << endl;
return 0;
}
}
cout << -1 << endl;
return 0;
}

浙公网安备 33010602011771号