제출 #375506

#제출 시각아이디문제언어결과실행 시간메모리
375506marat0210Prosjek (COCI18_prosjek)C++14
30 / 50
1 ms364 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    long double n;
    cin >>n;
    vector <long double> a(n);
    for (int i = 0; i < n; ++i) {
        cin >>a[i];
    }
    sort(a.begin(), a.end());
    long double av1 = (a[0] + a[1]) / 2;
    long double av2 = (a[2] + av1) / 2;
    long double av3 = (a[3] + av2) / 2;
    long double av4 = (a[4] + av3) / 2;
    if (n == 3) cout <<fixed<<setprecision(7)<<av2<<endl;
    else if (n == 4) cout <<fixed<<setprecision(7)<<av3<<endl;
    else cout <<fixed<<setprecision(7)<<av4<<endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...