-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP1546.java
More file actions
41 lines (30 loc) · 925 Bytes
/
P1546.java
File metadata and controls
41 lines (30 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package BOJ;
import java.util.*;
import java.io.*;
import java.text.DecimalFormat;
public class P1546 {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
ArrayList<Double> score = new ArrayList<Double>();
String[] s = br.readLine().split(" ");
for(int i=0;i<n;i++){
score.add(Double.parseDouble(s[i]));
}
Collections.sort(score);
ArrayList<Double> real = new ArrayList<Double>();
double max = score.get(n-1);
for(int i=0;i<n;i++){
double value = (double)(score.get(i)/max)*100;
real.add(value);
}
double sum=0;
for(int i=0;i<real.size();i++){
sum+=real.get(i);
}
DecimalFormat dformat = new DecimalFormat("#.00");
double number = (double)(sum/n);
System.out.println(dformat.format(number));
}
}