ACM (TJU) : 1412


#include <stdio.h>

int main ()
{
    int c;
    scanf ("%d", &c);

    while ( c-- ) {
        int n;
        scanf ("%d", &n);

        int number [1005];
        int sum = 0;

        for ( int i = 0; i < n; i++ ) {
            scanf ("%d", &number [i]);
            sum += number [i];
        }

        double avg = sum / (double) n;

        int count = 0;

        for ( int i = 0; i < n; i++ ) {
            if ( avg < number [i] )
                count++;
        }

        printf ("%.3lf%%\n", ( count / (double) n ) * 100);
    }

    return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s