program GradeStatistics;
uses math;

const
    MIN_STUDENTS = 10;

type
    TDataArray = array of Real;

var
    scores: TDataArray;
    count, i, j, passCount: Integer;
    inputVal: Real;
    sum, mean, median, minScore, maxScore, sumSqDiff, stdDev: Real;
    temp: Real;

begin
    count := 0;
    
    // 1. 標準入力（stdin）から点数をすべて読み込む
    while not SeekEof do
    begin
        read(inputVal); // 【修正】ReadLine から read に変更
        count := count + 1;
        SetLength(scores, count);
        scores[count - 1] := inputVal;
    end;

    // バリデーション：10人以上いるか確認
    if count < MIN_STUDENTS then
    begin
        writeln('エラー: 生徒の数は10人以上にする必要があります。（現在: ', count, '人）');
        Exit;
    end;

    // 2. 統計の計算（合計、最高点、最低点、合格者数）
    sum := 0;
    minScore := scores[0];
    maxScore := scores[0];
    passCount := 0;

    for i := 0 to count - 1 do
    begin
        sum := sum + scores[i];
        if scores[i] > maxScore then maxScore := scores[i];
        if scores[i] < minScore then minScore := scores[i];
        if scores[i] >= 60.0 then passCount := passCount + 1;
    end;

    mean := sum / count;

    // 3. 中央値計算のためにソート（バブルソート）
    for i := 0 to count - 2 do
    begin
        for j := 0 to count - 2 - i do
        begin
            if scores[j] > scores[j + 1] then
            begin
                temp := scores[j];
                scores[j] := scores[j + 1];
                scores[j + 1] := temp;
            end;
        end;
    end;

    // 中央値の決定
    if (count mod 2) = 1 then
        median := scores[count div 2]
    else
        median := (scores[(count div 2) - 1] + scores[count div 2]) / 2.0;

    // 4. 標準偏差の計算
    sumSqDiff := 0;
    for i := 0 to count - 1 do
    begin
        sumSqDiff := sumSqDiff + sqr(scores[i] - mean);
    end;
    stdDev := sqrt(sumSqDiff / count);

    // 5. 結果の出力
    writeln('--- 成績集計結果 ---');
    writeln('学生数    : ', count, ' 人');
    writeln('平均点    : ', mean:0:2);
    writeln('中央値    : ', median:0:2);
    writeln('最高点    : ', maxScore:0:2);
    writeln('最低点    : ', minScore:0:2);
    writeln('標準偏差  : ', stdDev:0:2);
    writeln('合格者数  : ', passCount, ' 人 (60点以上)');
    writeln;
    
    writeln('--- 各自の偏差値 ---');
    for i := 0 to count - 1 do
    begin
        if stdDev > 0 then
            temp := 50.0 + 10.0 * (scores[i] - mean) / stdDev
        else
            temp := 50.0;
        
        writeln('得点: ', scores[i]:6:2, ' -> 偏差値: ', temp:0:2);
    end;
end.