import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int cases = s.nextInt();
for(int i=0;i<cases;i++){
int n=s.nextInt();
int []arr=new int[n];
int sum=0;
float avg=0;
for(int j=0;j<arr.length;j++){
arr[j]=s.nextInt();
sum+=arr[j];
}
avg=(float)sum/n;
int count=0;
for(int j=0;j<arr.length;j++){
if(arr[j]>avg)
count++;
}
System.out.printf("%.3f%%%n", (float)count*100/n);
}
}
}
No comments:
Post a Comment