using namespace std; int n,m; struct people{ int k; int s; }peo[5010]; bool cmp(people &p1 , people &p2){ if(p1.s == p2.s){ return p1.k < p2.k; } return p1.s>p2.s; } int main(){ while(cin>>n>>m){ for(int i = 1 ; i<=n+1 ;++i){ ...