1.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS09
* Problem: 10370 Above Average
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=15&page=show_problem&problem=1311
*
* @author Kratzer Kevin
* @version 1.0, 10/07/2009
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.308
*/


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;



public class Main10370 {

protected final BufferedReader input;
public Main10370() {
input = new BufferedReader(new InputStreamReader(System.in));
}

void process() throws IOException {
String line = input.readLine();
int amount = Integer.parseInt(line);
for(int i=0;i < amount;i++) {
line = input.readLine();
String[] splitLine = line.split(" ");
int people = Integer.parseInt(splitLine[0]);
double allGrades = 0;
for(int j=1;j<people+1;j++) {
allGrades += Integer.parseInt(splitLine[j]);
}
double avg = allGrades/people;
double avgPPL = 0;
for(int j=1;j<people+1;j++) {
if(Integer.parseInt(splitLine[j]) > avg) {
avgPPL++;
}
}
System.out.printf("%.3f",(avgPPL/people)*100);
System.out.println("%");
}

}



public static void main(String... args) throws Exception {
new Main10370().process();
}
}

2.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS09
* Problem: 10370 Above Average
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=63&page=show_problem&problem=1311
*
* @author Christoph Hausmann
* @version 0.1, 10/7/2009
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.212
*/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class AboveAverage_10370 {
public static void main(String... args) throws NumberFormatException, IOException {
final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

int t = Integer.parseInt(br.readLine());

while(t > 0) {
t--;

final String[] lineSplit = br.readLine().split(" ");

final int[] curNumbers = new int[lineSplit.length];

for(int i = 0; i < lineSplit.length; i++) {
curNumbers[i] = Integer.parseInt(lineSplit[i]);
}

final double d = getAboveAverage(curNumbers);
System.out.printf( "%.3f", d);
System.out.println("%");

}
}

private static double getAboveAverage(int[] curNumbers) {
final double avg = getAverage(curNumbers);

int above = 0;

for(int i = 1; i < curNumbers.length; i++) {
if(curNumbers[i] > avg)
above++;
}

return ((double)above/curNumbers[0])*100.0;
}

private static double getAverage(int[] curNumbers) {
int avg = 0;

for(int i = 1; i < curNumbers.length; i++) {
avg += curNumbers[i];
}

return (double)avg/curNumbers[0];
}
}