#include #include #include using namespace std; const int N=100011; int n,m,ans[N]; struct node0 { int cost,index; }E[N]; struct node { int index,load; bool friend operator<(node n1,node n2) { return n2.loadcost-c->cost; } void solve() { int i; priority_queueq; node now; qsort(E,n,sizeof(E[0]),cmp); for(i=0;i