#include using namespace std; using ll = long long; constexpr int INF = (int)1e9 + 1001010; constexpr ll llINF = (ll)4e18 + 22000020; const string endn = "\n"; template inline auto vector2(size_t i, size_t j, const T &init = T()) {return vector(i, vector(j, init));} const string ELEM_SEPARATION = " ", VEC_SEPARATION = endn; template istream& operator >>(istream &i, vector &A) {for(auto &I : A) {i >> I;} return i;} template ostream& operator <<(ostream &o, const vector &A) {int i=A.size(); for(auto &I : A){o << I << (--i ? ELEM_SEPARATION : "");} return o;} template ostream& operator <<(ostream &o, const vector> &A) {int i=A.size(); for(auto &I : A){o << I << (--i ? VEC_SEPARATION : "");} return o;} template vector& operator ++(vector &A, int n) {for(auto &I : A) {I++;} return A;} template vector& operator --(vector &A, int n) {for(auto &I : A) {I--;} return A;} template bool chmax(T &a, const U &b) {return ((a < b) ? (a = b, true) : false);} template bool chmin(T &a, const U &b) {return ((a > b) ? (a = b, true) : false);} ll floor(ll a, ll b){if(b < 0) a = -a, b = -b; return a >= 0 ? a/b : (a+1)/b - 1;} ll ceil (ll a, ll b){if(b < 0) a = -a, b = -b; return a > 0 ? (a-1)/b + 1 : a/b;} ll bit(unsigned long long val, unsigned long long digit){return (val >> digit) & 1;} // ================================== ここまでテンプレ ================================== // 昇順または降順にソート済みの配列を入力とする // floor(中央値)を返す template T median(const vector &v){ // Tが整数型であることを確認 static_assert(is_integral::value, "T must be integral"); int n = v.size(); const T &l = v[n/2 - 1]; const T &r = v[n/2]; if(n%2 == 1) return r; else if(l > 0 != r > 0) return floor(l+r, 2); else return l + floor(r-l, 2); } // 昇順または降順にソート済みの配列を入力とする template string median_string(const vector &v){ // Tが整数型であることを確認 static_assert(is_integral::value, "T must be integral"); int n = v.size(); const T &l = v[n/2 - 1]; const T &r = v[n/2]; T mid; bool is_odd = false; if(n%2 == 1) mid = r; else if(l > 0 != r > 0){ mid = floor(l+r, 2); is_odd = (l + r) % 2; } else{ mid = l + floor(r-l, 2); is_odd = (r - l) % 2; } string ret; if(is_odd){ if(mid < 0) mid++; ret = to_string(mid) + (string)".5"; } else{ ret = to_string(mid); } return ret; } // 昇順または降順にソート済みの配列を入力とする template double median_double(const vector &v){ int n = v.size(); double l = v[n/2 - 1]; double r = v[n/2]; if(n%2 == 1) return r; else if(l > 0 != r > 0) return (l + r) / 2; else return l - (l - r) / 2; } int main(int argc, char *argv[]){ ios::sync_with_stdio(false); cin.tie(nullptr); ll n; cin >> n; vector a(n); cin >> a; sort(a.begin(), a.end()); string ans = median_string(a); cout << ans << endn; return 0; }