#include #include using namespace std; struct city { long int latitude; long int longitude; long int height; long int points; }; void getcity(city &e) { cin >> e.latitude >> e.longitude >> e.height >> e.points; } void merge(city a[],long int low,long int mid,long int high) { long int i=low,j=mid+1,k=low; city b[100000]; while(i<=mid && j<=high) { if(a[i].height>a[j].height) b[k++]=a[i++]; else if((a[i].height==a[j].height)&&(a[i].points=high) return; mid=(low+high)/2; mergesort(a,low,mid); mergesort(a,mid+1,high); merge(a,low,mid,high); } int main(){ long int n; long int x; long int y; cin >> n >> x >> y; city c[n]; for(long int i = 0; i < n; i++) { getcity(c[i]); } // sort(c,n); mergesort(c,0,n-1); long int p=c[0].points; for(long int i=0;i