#include<iostream>#include<cstdio>#defineintlonglongusingnamespace std;constint N =100010;structnode{longlong num, t;} h[N], x;signedmain(){int n;
cin >> n;for(int i =0; i < n; i ++){
cin >> h[i].t;
h[i].num = i +1;}for(int i =0; i < n; i ++){for(int j =0; j < n - i -1; j ++){if(h[j].t > h[j +1].t){
x = h[j];
h[j]= h[j +1];
h[j +1]= x;}}}double res =0;for(int i =0; i < n; i ++){
cout << h[i].num <<' ';
res += h[i].t *(n - i -1);}
cout << endl;printf("%.2lf", res / n);return0;}