/* -*- coding: utf-8 -*- * * 3632.cc: No.3632 IQR - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 400000; /* typedef */ /* global variables */ int as[MAX_N]; /* subroutines */ double med(int l, int r) { int x = (l + r) / 2; if ((r - l) & 1) return as[x]; return (as[x - 1] + as[x]) * 0.5; } /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", as + i); sort(as, as + n); double q1 = med(0, n / 2); double q2 = med(0, n); double q3 = med(n - n / 2, n); double iqr = q3 - q1; double mina = q1 - 1.5 * iqr; double maxa = q3 + 1.5 * iqr; int cnt = 0; for (int i = 0; i < n; i++) if (as[i] < mina || as[i] > maxa) cnt++; printf("%.1lf %.1lf %.1lf %d\n", q1, q2, q3, cnt); return 0; }