// yukicoder: No.275 中央値を求めよ // 2019.4.14 bal4u #include #include //// 高速入力 #if 0 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int in() // 整数の入力(負数に対応) { int n = 0, c = gc(); if (c == '-') { c = gc(); do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0'); return -n; } do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0'); return n; } int N; int a[1005]; int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int i, s; N = in(); for (i = 0; i < N; i++) a[i] = in(); qsort(a, N, sizeof(int), cmp); if (N & 1) printf("%d\n", a[N / 2]); else { s = a[N/2 - 1] + a[N/2]; if ((s & 1) == 0) printf("%d\n", s / 2); else if (s == -1) puts("-0.5"); else printf("%d.5\n", s / 2); } return 0; }