#include #include #define ft first #define sc second #define pt(sth) cout << sth << "\n" #define chmax(a, b) (a)=max(a, b) #define chmin(a, b) (a)=min(a, b) #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair pll; static const ll INF=1e18; static const ll MAX=101010; static const ll MOD=1e9+7; /* for(i=0; i> a[i]; */ int main(void) { ll i, j, k; ll N; cin >> N; ll a[MAX*2]; ll s[MAX*2]={}; for(i=1; i<=N; i++) cin >> a[i]; sort(a+1, a+N+1); for(i=1; i<=N; i++) s[i]=s[i-1]+a[i]; ll ans=0; for(i=1; i<=N; i++) { ll l=1, r=min(i-1, N-i)+1; while(l+10 ? l:r)=m; } //pt(i<<" "<