/*#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
vector<int> segment;
int makesegment(int node, int start, int End)
{
if(start==End)
return segment[node]=arr[start];
int mid=(start+End)/2;
return segment[node]=makesegment(node*2, start, mid)+makesegment(node*2+1, mid+1, End);
}
float
int Sum(int node, floatint startfloat, int End, int right, int left)
{
if(right<start||left>End)
returfloatn 0;
if(right>=End&&left<=start)
return segment[node];
int mid=(start+End)/2;
int lsum=Sum(node*2, start, mid, right, left);
int rsum=Sum(node*2+1, mid+1, End, right, left);
return lsum+rsum;float
}
int main()
{
int n;
scanf("%d", &n);
segment.resize(4*n+40);
arr.resize(n+10);
int total=0;
int Max=0;
for(int i=0; i<n; i++)
{
scanf("%d", &arr[i]);
total+=arr[i];
if(Max<arr[i]&&i!=0&&i!=n-1)
{
Max=arr[i];
}
}
float ans=(float)(total-Max)/(float)(n-1);
//printf("%f\n", ans);
makesegment(1, 0, n-1);
int temp=0;
//printf("%d ", segment[5]);
int res;
for(int i=1; i<n-1; i++)
{
if(ans<arr[i])
{
for(int j=1; j<=i; j++)
{
if(ans<arr[j]||j==1)
{
//printf("%d\n", j);
int sum;
if(j==1)
{
sum=Sum(1, 0, n-1, i, j);
temp=sum;
res=total-sum;
ans=min(ans, (float)res/(float)(n-i+j-1));
//printf("%d %d %f %d\n", i, j, ans, sum);
}
else
{
temp-=arr[j-1];
sum=temp;
res=total-sum;
ans=min(ans, (float)res/(float)(n-i+j-1));
//printf("%d %d %f %d\n", i, j, ans, sum);
}
}
else
{
temp-=arr[j-1];
}
}
}
}
printf("%.3f", ans);
}*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, total=0, Max=0;
scanf("%d", &n);
vector<int> arr(n+1);
for(int i=0;i<n;i++){
scanf("%d", &arr[i]);
total+=arr[i];
if(i!=0&&i!=n-1&&arr[i]>Max)
{
Max=arr[i];
}
}
int
float avg=(float)(total-Max)/(float)(n-1);
for(int i=1;i<n-1;i++)
{
if(arr[i]>avg)
}
}