#include #include #include #include #include #include #include // (n, p, n, x, m, y, m, r); long int maximumPeople(int n, long int* p, long int* x,long int* y, int m, long int* r) { // Return the maximum number of people that will be in a sunny town after removing exactly one cloud. long int i=0,total=0,max=0,rmin,rmax,j,maxl=x[0]; for(i=1;i=rmin && x[j]<=rmax) { check[x[j]]++; } } } for(i=0;i=rmin && x[j]<=rmax) { check[x[j]]=check[x[j]]-1; if(check[x[j]]<=0) { total=total+p[j]; check[x[j]]=check[x[j]]-1; } } } if(total>max) max=total; } for(i=0;i