#include #include #include #include using namespace std; const int N=1e5+10; int cnt[N]; struct Team { int s,p,u,id; }a[N]; int main() { //freopen("icpc.in","r",stdin); //freopen("icpc.out","w",stdout); int n,k; vector,int> >u[N]; priority_queue,int>,int> >q; scanf("%d %d",&n,&k); for(int i=0;i