#include #include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n,x,y; cin>>n>>x>>y; vector< pair > > > v; for(int i=0;i>la>>lo>>h>>p; v.push_back(make_pair(h,make_pair(p,make_pair(la,lo)))); } sort(v.begin(),v.begin()+n); int map=0,f=0,llo,lla; vector< pair > > >::iterator it; for(it=v.begin();it!=v.end();it++) { if(f==0) { {map+=it->second->first; f=1; lla=it->second->second->first; llo=it->second->second->second; } } else{ if(((abs(it->second->second->first-lla)<=x)&&(abs(it->second->second->second-llo)<=y))) {map+=it->second->first; lla=it->second->second->first; llo=it->second->second->second; } } } cout<