#include<iostream>
#include<cstdio>
#include<algorithm>
#define rep(i,l,r) for(register int i=l;i<=r;i++)
#define per(i,r,l) for(register int i=r;i>=l;i--)
using namespace std;
int read()
{
int res=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-') f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
res=res*10+ch-'0';
ch=getchar();
}
return res*f;
}
int n,m,cnt,luquxian;
struct node
{
int bian;
int fenshu;
}ren[5100];
int cmp(node x,node y)
{
if(x.fenshu>y.fenshu) return 1;
if(x.fenshu==y.fenshu&&x.bian<y.bian) return 1;
return 0;
}
int main()
{
n=read();m=read();m=m*3/2;
rep(i,1,n)
{
ren[i].bian=read();
ren[i].fenshu=read();
}
sort(ren+1,ren+n+1,cmp);
luquxian=ren[m].fenshu;
rep(i,1,n)
{
if(ren[i].fenshu>=luquxian) cnt++;
else break;
}
printf("%d %d\n",luquxian,cnt);
rep(i,1,cnt)
printf("%d %d\n",ren[i].bian,ren[i].fenshu);
return 0;
}
洛谷 P1068 分数线划定
最新推荐文章于 2022-10-12 12:46:50 发布