#ifndef ONLINE_JUDGE #include "header.hpp" #else #include #include #include using cpp_int=boost::multiprecision::cpp_int; #include templateusing cpp_float=boost::multiprecision::number>; templateusing cpp_double=boost::multiprecision::number>; #endif using namespace std; using ll=long long; inline void yn(bool x){if(x){cout<<"Yes"< inline void erase_duplicate(vector& A){sort(A.begin(),A.end());A.erase(unique(A.begin(),A.end()),A.end());} inline ll powll(ll x,ll n){ll r=1;while(n>0){if(n&1){r*=x;};x*=x;n>>=1;};return r;} using namespace std; using ll=long long; struct CLX{ ll C,L,X; bool operator<(CLX clx)const{ return L>N>>Y>>Z; vector clx(N); for(ll i=0;i>clx[i].C>>clx[i].L>>clx[i].X; } sort(clx.begin(),clx.end()); ll ans=0; priority_queue pq; ll idx=0; while(idxc){ Y+=x*c; ans+=c; }else{ Y+=x*cnt; ans+=cnt; c-=cnt; if(c>0){ pq.push({c,x}); } } } // cerr<<"Y: "<