#include #define DEBUG int main(void){ int n; scanf("%d", &n); int a[n]; for(int i = 0; i < n; i++){ scanf("%d", a+i); } int i = 1; int temp; while(i){ i = 0; for(int j = 0; j < n-1; j++){ if(a[i] < a[i+1]){ temp = a[i+1]; a[i+1] = a[i]; a[i] = temp; i++; } } } #ifdef DEBUG for(int i = 0; i < n; i++){ printf("%d ", a[i]); } printf("\n"); #endif if(n % 2 != 0){ printf("%d\n", a[n/2]); } else{ float b, c; b = a[(n-2)/2]; c = a[n/2]; printf("%f\n", (b+c)/2); } return 0; }