#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int b[1090];
struct play
{
int right;
int left;
};
#include <algorithm>
#include <cstdio>
using namespace std;
int b[1090];
struct play
{
int right;
int left;
};
bool cmp(play a,play b)
{
return a.left<b.left;
}
{
return a.left<b.left;
}
int main()
{
int n,i;
scanf("%d",&n);
struct play a[1009];
for(i=0;i<n;i++)
{
a[i].right=i+1;
scanf("%d",&a[i].left);
}
sort(a,a+n,cmp);
double s=0;
for(i=0;i<n;i++)
{
printf("%d ",a[i].right);
if(i==0) continue;
b[i]=b[i-1]+a[i-1].left;
s+=b[i]*1.;
}
printf(" ");
double t;
t=s/(n*1.);
printf("%.2lf",t);
return 0;
}
{
int n,i;
scanf("%d",&n);
struct play a[1009];
for(i=0;i<n;i++)
{
a[i].right=i+1;
scanf("%d",&a[i].left);
}
sort(a,a+n,cmp);
double s=0;
for(i=0;i<n;i++)
{
printf("%d ",a[i].right);
if(i==0) continue;
b[i]=b[i-1]+a[i-1].left;
s+=b[i]*1.;
}
printf(" ");
double t;
t=s/(n*1.);
printf("%.2lf",t);
return 0;
}