#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include using namespace std; typedef long long ll; const int INF = 1<<30; const ll INFLL = 1LL<<60; const ll MOD = 998244353; const double INFD = 1.0E10; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, -1, 0, 1}; map dm = {{0, 'D'}, {1, 'L'}, {2, 'U'}, {3, 'R'}}; // const int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1}; // const int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1}; using Pair = pair; using mint = atcoder::modint998244353; // using mint = atcoder::modint1000000007; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); ll n; cin >> n; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); auto med = [](vector vec, int l, int r) -> double{ //区間[l,r]の中央値 int n = r - l + 1; if (n % 2) return vec[l + n / 2]; else return (vec[l + n / 2 - 1] + vec[l + n / 2]) / 2.0; }; double q1, q2, q3; q2 = med(a, 0, n - 1); q1 = med(a, 0, n / 2 - 1); q3 = med(a, (n + 1) / 2, n - 1); double IQR = q3 - q1; int cnt = 0; for (int i = 0; i < n; i++){ if (a[i] < q1 - 1.5 * IQR || q3 + 1.5 * IQR < a[i]) cnt++; } cout << q1 << " " << q2 << " " << q3 << " " << cnt << endl; return 0; }