#include<iostream>
#include<algorithm>
using namespace std;
struct str{
int time,shunxu,cnt;
}a[1001];
bool cmp(str x,str y){return x.time < y.time;}
int n;
int main(){
scanf("%d",&n);
for(int i = 1;i <= n;i++){
scanf("%d",&a[i].time);
a[i].shunxu = i;
}
sort(&a[1],&a[n+1],cmp);
a[1].cnt = a[1].time;
for(int i = 1;i <= n;i++) a[i].cnt = a[i].time+a[i-1].cnt;
for(int i = 1;i <= n;i++) printf("%d ",a[i].shunxu);
printf("\n%.2f",(double)a[n].cnt/(double)n);
return 0;
}
样例输入:
10
56 12 1 99 1000 234 33 55 99 812
样例输出:
3 2 7 8 1 4 9 6 10 5
291.90
实际输出:
3 2 7 8 1 4 9 6 10 5
240.10