#include #include #include using namespace std; ifstream fin("serbare.in"); ofstream fout("serbare.out"); struct copil { char p[51]; int h; } v[101]; int cond(copil a, copil b) { if(a.h>b.h)return 0; else if(a.h==b.h&&strcmp(a.p,b.p)>0)return 0; return 1; } int cond1(copil a, copil b) { if(a.h0)return 0; return 1; } int n, i,j, k, fr[151], frmax, cer,hmax,x,y,ult; int main() { fin>>cer; fin>>n; for(i=1; i<=n; i++) { fin>>v[i].p>>v[i].h; if(v[i].h>hmax)hmax=v[i].h; fr[v[i].h]++; if(fr[v[i].h]>frmax) frmax=fr[v[i].h]; } if(cer==1) { fout<=ult+1; i--) for(j=1; j<=fr[i]; j++) fout<