//取最大最小值直接做个排序就好
int cmp(const void* a,const void* b)
{
return (*(int*)a - *(int*)b);
}
int main()
{
int num;
double sum = 0;
double ave = 0;
float *p;
scanf("%d", &num);
p = (float*)malloc(num * sizeof(float));
if(p != NULL)
{
for(int i = 0; i < num; i++)
{
scanf("%f", &p[i]);
}
qsort(p, num, sizeof(float), cmp);
for(int i = 0; i < num; i++)
{
sum += (double)p[i];
}
ave = (double)sum/num;
printf("%.2f %.2f %.2f",*(p + num -1), *p, ave);
}
free(p);
return 0;
}