#include<bits/stdc++.h>
using namespace std;
struct node
{
int my;string id;
}c[10005];
int accm(node a,node b)
{
if(a.my==b.my)
return a.id<b.id;
else return a.my>b.my;
}
int main()
{
int d,e,f,g=0,p;
cin>>d>>e>>f;
for(int i=1;i<=d;i++)
{
cin>>c[i].id>>c[i].my;
if(c[i].my>=60&&c[i].my<e)
g=g+20;
if(c[i].my>=e)
g=g+50;
}
cout<<g<<endl;
sort(c+1,c+1+d,accm);int h=1;
for(int i=1;i<=f;i++)
{
if(i==1)
{
cout<<i<<" "<<c[i].id<<" "<<c[i].my<<endl;
h=i;p=i;
}
else
{
if(c[i].my!=c[i-1].my)
{
h=i;
cout<<i<<" "<<c[i].id<<" "<<c[i].my<<endl;p=i;
}
else
{
cout<<h<<" "<<c[i].id<<" "<<c[i].my<<endl;p=h;
}
}
}
while(1)
{
if(c[f].my!=c[f+1].my)
break;
else
{
cout<<p<<" "<<c[f+1].id<<" "<<c[f+1].my<<endl;
f++;
}
}
return 0;
}
L2-027 名人堂与代金券 (25 分)(天梯赛)
最新推荐文章于 2022-04-22 15:48:21 发布