#include<iostream>
#include <iomanip>
#include<algorithm>
using namespace std;
const int maxn = 1e3 + 5;
struct people
{
long long t, idx;
}p[maxn];
bool cmp(const people& a, const people& b)
{
if (a.t == b.t) return a.idx < b.idx;
else
return a.t < b.t;
}
int main() {
long long n;
cin >> n;
for (int i = 1; i <= n; ++i)
{
cin >>p[i].t;
p[i].idx = i;
}
sort(p + 1, p + n + 1, cmp);
double a=0.0;
for (int i = 1; i <= n; ++i)
{
cout << p[i].idx<<" ";
a += p[i].t * (n - i);
}
printf("\n%.2f", a/ n);
return 0;
}
03-05
99
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-10