#include <algorithm>
#include <cstdint>
#include <cstdlib>
#include <iomanip>
#include <ios>
#include <iostream>
#include <ostream>
#include <utility>
#include <vector>


int main(){
    using ll = int64_t;
    ll n,nowWait=0,sumWait=0;
    std::cin>>n;
    std::vector<std::pair<ll, ll>> a(n+1);
    for(ll i=1;i<=n;i++){
        std::cin>>a[i].first;
        a[i].second=i;
    }
    std::sort(a.begin()+1,a.end());
    for(ll i=1;i<=n;i++){
        sumWait+=nowWait;
        std::cout<<a[i].second<<" ";
        nowWait+=a[i].first;
    }
    std::cout<<std::fixed<<std::setprecision(2)<<'\n'<<(double(sumWait)/double(n))<<'\n'<<std::flush;
    quick_exit(0);
}