#include<bits/stdc++.h>
using namespace std;
struct paidui
{
double ti;
int id;
};
bool cmp(paidui a,paidui b)
{
if(a.ti == b.ti) return a.id < b.id;
return a.ti < b.ti;
}
paidui a[1010];
int main()
{
int n;
double cnt = 0;
cin >> n;
for(int i = 1; i <= n; i++)
{
cin >> a[i].ti;
a[i].id = i;
}
sort(a+1,a+n+1,cmp);
for(int i = 1; i <= n; i++)
{
cout << a[i].id << " ";
for(int j = i-1; j >= 1; j--)
{
cnt += a[j].ti;
}
}
cout << endl;
cnt /= n;
cout << fixed << setprecision(2) << cnt;
return 0;
}