import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; class stu{ int num; int score; public stu(int num,int score){ this.num=num; this.score=score; } } public class Main{ public static void main(String[] args) throws IOException { BufferedReader sc=new BufferedReader(new InputStreamReader(System.in)); PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out)); String[]nm=sc.readLine().split(" "); int n=Integer.parseInt(nm[0]); int m=Integer.parseInt(nm[1]); stu[]s=new stu[n]; for (int i = 0; i < s.length; i++) { nm=sc.readLine().split(" "); s[i]=new stu(Integer.parseInt(nm[0]),Integer.parseInt(nm[1])); } for (int i = 0; i < s.length-1; i++) { for (int j = 0; j < s.length-1; j++) { if(s[j].score<s[j+1].score || s[j].score==s[j+1].score&&s[j].num>s[j+1].num){ stu st=s[j]; s[j]=s[j+1]; s[j+1]=st; } } } double num=m*1.5; if(num>n)num=n; int a=(int)num-1; for (int i = a+1; i < n; i++) { if(s[i].score==s[a].score)num++; } out.println(s[(int)num-1].score+" "+(int)num); for (int i = 0; i < (int)num; i++) { out.println(s[i].num+" "+s[i].score); } out.flush(); } }
0.0分
0 人评分