#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define sz(v) (int)v.size()
#define all(v) v.begin(), v.end()
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template < typename T_container, typename T = typename enable_if < !is_same<T_container, string>::value, typename T_container::value_type >::type >
ostream & operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << "\b\b]\n"; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << H << ", "; dbg_out(T...);}
#define watch(...) cerr << "[" << #__VA_ARGS__ << "]: [", dbg_out(__VA_ARGS__)


int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);

    int a, b; cin >> a >> b;
    vector <ll> ans;
    if (a >= b) {
        for (int i = 1; i <= a; ++i)
            ans.push_back(i);
        for (int i = 1; i < b; ++i)
            ans.push_back(-i);
        ll sum = 0;
        for (int i = b; i <= a; ++i)
            sum += i;
        ans.push_back(-sum);
    }
    else {
        for (int i = 1; i <= b; ++i)
            ans.push_back(-i);
        for (int i = 1; i < a; ++i)
            ans.push_back(i);
        ll sum = 0;
        for (int i = a; i <= b; ++i)
            sum += i;
        ans.push_back(sum);
    }
    for (auto i : ans)
        cout << i << ' ';

    return 0;
}


/*

*/
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

double fc(vector<int> &a, double x) {
  double res = 0;
  int n = a.size();
  rep(i, n) {
    res += a.at(i);
    res -= min((double)a.at(i), 2*x);
  }
  res /= n;
  res += x;
  return res;
}

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a.at(i);
  double l = 0, r = 1e10;
  rep(_i, 300) {
    double ml = (l*2+r)/3, mr = (l+r*2)/3;
    double mlp = fc(a, ml), mrp = fc(a, mr);
    if(mlp < mrp) r = mr;
    else l = ml;
  }
  double ans = fc(a, (l+r)/2);
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}