import java.util.*;
import java.lang.*;
import java.io.*;
class MidApp
{
//private static final int ARRAY_SIZE_MAX = 1024;
public static Integer scanInteger
( Scanner in
) {
return ( ( in.hasNextInt() ) ? in.nextInt() : null );
}
public static Double scanDouble
( Scanner in
) {
return ( ( in.hasNextDouble() ) ? in.nextDouble() : null );
}
public static void main
( String[] args
) {
// рабочие переменные
double avg = 0;
double disp = 0;
int k = 0;
int n = 0;
Scanner in
= new Scanner
(System.
in);
n = scanInteger( in );
if( n <= 0 )
{
System.
out.
printf("error: wrong value of n\n"); return;
}
double[] x = new double[ n ];
k = n;
// вычисление среднего значения
for( int i = 0; i < k; i++ )
{
x[i] = scanDouble( in );
if( x[i] < 1 )
{
System.
out.
printf("error: incomplete input of x\n"); return;
}
avg += x[i];
}
avg /= k;
in.close();
// вычисление дисперсии
for( int i = 0; i < k; i++ )
{
disp += ( x[i] - avg ) * ( x[i] - avg );
}
disp /= ( k - 1 );
// вывод результата
System.
out.
printf("%f\n", avg
); System.
out.
printf("%f", disp
); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNaWRBcHAKewogICAvL3ByaXZhdGUgc3RhdGljIGZpbmFsIGludCBBUlJBWV9TSVpFX01BWCA9IDEwMjQ7CiAgIAogICBwdWJsaWMgc3RhdGljIEludGVnZXIgc2NhbkludGVnZXIoIFNjYW5uZXIgaW4gKQogICB7CgkgICByZXR1cm4gKCAoIGluLmhhc05leHRJbnQoKSApID8gaW4ubmV4dEludCgpIDogbnVsbCApOwogICB9CgogICBwdWJsaWMgc3RhdGljIERvdWJsZSBzY2FuRG91YmxlKCBTY2FubmVyIGluICkKICAgewoJICAgcmV0dXJuICggKCBpbi5oYXNOZXh0RG91YmxlKCkgKSA/IGluLm5leHREb3VibGUoKSA6IG51bGwgKTsKICAgfQogICAKICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oIFN0cmluZ1tdIGFyZ3MgKQogICB7CiAgICAgIC8vINGA0LDQsdC+0YfQuNC1INC/0LXRgNC10LzQtdC90L3Ri9C1CiAgICAgIGRvdWJsZSBhdmcgPSAwOwogICAgICBkb3VibGUgZGlzcCA9IDA7CiAgICAgIGludCBrID0gMDsKICAgICAgaW50IG4gPSAwOwogICAgICAKICAgICAgU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7ICAgICAgCgogICAgICBuID0gc2NhbkludGVnZXIoIGluICk7CiAgICAgIAogICAgICBpZiggbiA8PSAwICkKICAgICAgewogICAgICAJIFN5c3RlbS5vdXQucHJpbnRmKCJlcnJvcjogd3JvbmcgdmFsdWUgb2YgblxuIik7CiAgICAgICAgIHJldHVybjsKICAgICAgfQogICAgICAKICAgICAgZG91YmxlW10geCA9IG5ldyBkb3VibGVbIG4gXTsKCiAgICAgIGsgPSBuOyAKICAgICAgCiAgICAgIC8vINCy0YvRh9C40YHQu9C10L3QuNC1INGB0YDQtdC00L3QtdCz0L4g0LfQvdCw0YfQtdC90LjRjwogICAgICBmb3IoIGludCBpID0gMDsgaSA8IGs7IGkrKyApCiAgICAgIHsKICAgICAgICAgeFtpXSA9IHNjYW5Eb3VibGUoIGluICk7CiAgICAgICAgIGlmKCB4W2ldIDwgMSApCiAgICAgICAgIHsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGYoImVycm9yOiBpbmNvbXBsZXRlIGlucHV0IG9mIHhcbiIpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgYXZnICs9IHhbaV07CiAgICAgIH0KICAgICAgYXZnIC89IGs7CiAgICAgIAogICAgICBpbi5jbG9zZSgpOwogICAgICAKICAgICAgLy8g0LLRi9GH0LjRgdC70LXQvdC40LUg0LTQuNGB0L/QtdGA0YHQuNC4CiAgICAgIGZvciggaW50IGkgPSAwOyBpIDwgazsgaSsrICkKICAgICAgewogICAgICAgIGRpc3AgKz0gKCB4W2ldIC0gYXZnICkgKiAoIHhbaV0gLSBhdmcgKTsKICAgICAgfQogICAgICBkaXNwIC89ICggayAtIDEgKTsKICAgICAgCiAgICAgIC8vINCy0YvQstC+0LQg0YDQtdC30YPQu9GM0YLQsNGC0LAKICAgICAgU3lzdGVtLm91dC5wcmludGYoIiVmXG4iLCBhdmcpOwogICAgICBTeXN0ZW0ub3V0LnByaW50ZigiJWYiLCBkaXNwKTsKICAgfQp9Cg==