1import java.util.*;
2import java.io.*;
3import java.text.*;
4
5public class Main
6{
7 public static void main(String[]ages) throws IOException
8 {
9 BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
10 String line;
11 HashMap map = new HashMap();
12 int count = 0;
13 while( (line=stdin.readLine())!=null )
14 {
15 count++;
16 if(map.containsKey(line))
17 {
18 int freq = Integer.parseInt(map.get(line).toString());
19 map.remove(line);
20 map.put(line, String.valueOf(freq+1));
21 }
22 else
23 {
24 map.put(line,"1");
25 }
26 }
27
28 List list = new ArrayList(map.entrySet());
29 Collections.sort(list, new Comparator() {
30 public int compare(Object o1, Object o2) {
31 Map.Entry obj1 = (Map.Entry) o1;
32 Map.Entry obj2 = (Map.Entry) o2;
33 return obj1.getKey().toString().compareTo(obj2.getKey().toString());
34 }}
35 );
36
37 Iterator iter = list.iterator();
38 while(iter.hasNext())
39 {
40 Map.Entry entry = (Map.Entry) iter.next();
41 int value = Integer.parseInt(entry.getValue().toString());
42 System.out.print( entry.getKey().toString()+" ");
43 DecimalFormat df = new DecimalFormat("0.0000");
44
45 System.out.println(df.format(value*100.0/count));
46 }
47 }
48}
2import java.io.*;
3import java.text.*;
4
5public class Main
6{
7 public static void main(String[]ages) throws IOException
8 {
9 BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
10 String line;
11 HashMap map = new HashMap();
12 int count = 0;
13 while( (line=stdin.readLine())!=null )
14 {
15 count++;
16 if(map.containsKey(line))
17 {
18 int freq = Integer.parseInt(map.get(line).toString());
19 map.remove(line);
20 map.put(line, String.valueOf(freq+1));
21 }
22 else
23 {
24 map.put(line,"1");
25 }
26 }
27
28 List list = new ArrayList(map.entrySet());
29 Collections.sort(list, new Comparator() {
30 public int compare(Object o1, Object o2) {
31 Map.Entry obj1 = (Map.Entry) o1;
32 Map.Entry obj2 = (Map.Entry) o2;
33 return obj1.getKey().toString().compareTo(obj2.getKey().toString());
34 }}
35 );
36
37 Iterator iter = list.iterator();
38 while(iter.hasNext())
39 {
40 Map.Entry entry = (Map.Entry) iter.next();
41 int value = Integer.parseInt(entry.getValue().toString());
42 System.out.print( entry.getKey().toString()+" ");
43 DecimalFormat df = new DecimalFormat("0.0000");
44
45 System.out.println(df.format(value*100.0/count));
46 }
47 }
48}