#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<iomanip>
using namespace std;
struct peo{
int time;
int id;
};
bool cmp(peo a,peo b){
return a.time<b.time;
}
int main()
{
int n;
peo s[1001];
double t=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>s[i].time;
s[i].id=i+1;
}
sort(s,s+n,cmp);
for(int i=0;i<n;i++){
if(i!=n-1){
cout<<s[i].id<<" ";
}
else{
cout<<s[i].id;
}
t+=(n-i-1)*s[i].time;
}
cout<<endl;
printf("%.2f",t/n);
return 0;
}