提交时间:2023-12-04 22:58:39
运行 ID: 33043
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n+1], b[n+1], g[n+1], k[n+1]; for(int i = 1; i <= n; i++) { cin >> a[i] >> b[i] >> g[i] >> k[i]; } int x, y; cin >> x >> y; for(int i = n; i >= 1; i--) { if(x>=a[i] && x<=a[i]+g[i] && y>=b[i] && y<=b[i]+k[i]) { cout << i; return 0; } } cout << -1; return 0; }