# L2-3 Hall of fame and voucher (25 points) java

For MOOC in Chinese Universities( http://www.icourse163.org/ )For students studying "data structure" course, if they want to obtain a certificate of competency, they must have a total score of 60 or above, plus benefits: those with a total score of [G, 100] can get a 50 yuan PAT voucher; those with a total score of [60, g] can get a 20 yuan PAT voucher. The national examination center is universal and valid for one year. At the same time, the teacher will include the top K students in the "Hall of fame". Please write a program to help the teacher list the students in the hall of fame and count the par value of PAT vouchers.

### Input format:

Input three integers given in the first line, namely, n (positive integer no more than 10000, which is the total number of students), G (integer in the (60100) range, which is the grade dividing line of the voucher described in the question surface), K (positive integer no more than 100 and no more than N, which is the lowest ranking in the hall of fame). Next N lines, each line gives a student's account number (string with no more than 15 characters in length and no spaces) and total score (integer in the range [0, 100]), separated by spaces. There are no duplicate accounts.

### Output format:

First, output the total face value of the issued PAT voucher in one line. Then, the student's ranking, account number and score are output in non ascending order according to the total score, separated by one space. It should be noted that students with the same score enjoy the same ranking. When ranking in parallel, they are output in ascending alphabetical order according to the account number.

### Input example:

```10 80 5
cy@zju.edu.cn 78
cy@pat-edu.com 87
1001@qq.com 65
uh-oh@163.com 96
test@126.com 39
anyone@qq.com 87
zoe@mit.edu 80
jack@ucla.edu 88
bob@cmu.edu 80
ken@163.com 70

```

### Output example:

``````360
1 uh-oh@163.com 96
2 jack@ucla.edu 88
3 anyone@qq.com 87
3 cy@pat-edu.com 87
5 bob@cmu.edu 80
5 zoe@mit.edu 80
```

```

Last test point timeout

``````import java.io.IOException;
import java.io.*;
import java.util.*;

//** Class for buffered reading int and double values *//*
static StringTokenizer tokenizer;

// ** call this method to initialize reader for InputStream *//*
static void init(InputStream input) {
tokenizer = new StringTokenizer("");
}

// ** get next word *//*
static String next() throws IOException {
while (!tokenizer.hasMoreTokens()) {
// TODO add check for eof if necessary
}
}

static String nextLine() throws IOException {
}
static char nextChar() throws IOException {
return next().charAt(0);
}
static int nextInt() throws IOException {
return Integer.parseInt(next());
}

static long nextLong() throws IOException {
return Long.parseLong(next());
}

static double nextDouble() throws IOException {
return Double.parseDouble(next());
}
}

public class Main {
static int n;
static int g;
static int k;
static class Person{
String account;
}
static Person[]person;
public static void main(String[] args) throws IOException {
person = new Person[n+1];
person[0] = new Person();
for (int i = 1; i <= n; i++) {
person[i] = new Person();
}
Arrays.sort(person, 1, n+1, new Comparator<Person>() {

@Override
public int compare(Person o1, Person o2) {
// TODO Auto-generated method stub
return 1;
return o1.account.compareTo(o2.account);
} else {
return -1;
}

}
});
int sum = 0;
for (int i = 1; i < person.length; i++) {
sum+=50;
sum+=20;
} else {
break;
}
}
System.out.println(sum);
int rank = 1;
for (int i = 1; i < person.length; i++) {
} else {
if (i>k) {
break;
}
``` ```
``` Give the thumbs-up Collection share Article report pan zun Published 62 original articles, won praise 9, visited 2287 Private letter follow ```
``` Tags: Java Posted on Fri, 07 Feb 2020 06:09:30 -0800 by updwebmaster ```
``` ```
``` ©2020 Coder Club var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?71ea2a0dabfc0d6507f6b3b7be44299f"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-136936861-3'); ```