提交时间:2026-06-12 15:49:21
运行 ID: 91462
#include<bits/stdc++.h> using namespace std; int n,m,sum; struct node{ int h,f; }; node p[5005]; bool cmp(node x,node y){ if(x.f!=y.f)return x.f>y.f; return x.h<y.h; } int main(){ scanf("%d%d",&n,&m); for(int i=1;i<=n;i++)scanf("%d%d",&p[i].h,&p[i].f); sort(p+1,p+n+1,cmp); m*=1.5; for(int i=1;i<=n&&p[i].f>=p[m].f;i++)sum++; printf("%d %d\n",p[m].f,sum); for(int i=1;i<=sum;i++)printf("%d %d\n",p[i].h,p[i].f); return 0; }