1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include<iostream> using namespace std; int main(){ int n; cin>>n; int a[10001],b[10001],g[10001],k[10001]; for(int i=1;i<=n;i++){ cin>>a[i]>>b[i]>>g[i]>>k[i]; } int x,y; bool l=0; cin>>x>>y; for(int d=n;d>=1;d--){ if(x>=a[d]&&x<=a[d]+g[d]&&y<=b[d]+k[d]&&y>=b[d]){ cout<<x<<" "<<y<<endl; return 0; } } cout<<"-1"<<endl; return 0; }
|