#include using namespace std; typedef long long int ll; #define PII pair struct comp_pair_ll { bool operator()(const PII &a, const ll & b) { return (a.first < b); } bool operator()(const ll & a,const PII &b) { return (a < b.first); } }; int main() { ll n; cin>>n; ll x[n],p[n]; ll totp=0; for(ll i=0;i>p[i]; totp+=p[i]; } vector v; for(ll i=0;i>x[i]; v.push_back(make_pair(x[i],p[i])); } sort(v.begin(),v.end()); ll prev=v[0].second; for(ll i=1;i>m; ll y[m],r[m]; for(ll i=0;i>y[i]; } for(ll i=0;i>r[i]; } vector tt; ll effect[m]; ll totaleffec=0; for(ll i=0;i