#include using namespace std; int main(){ int n; cin >> n; int nums[n]; int i,j,index=1; for(i = 0; i < n; i++){ cin >> nums[i]; } int min = nums[0]; int minIndex; for(i = 0; i < n; i++){ min = nums[i]; int change = 0; for(j = i; j < n; j++){ if(min > nums[j]){ min = nums[j]; minIndex = j; change = 1; } } if(change){ int tmp = nums[i]; //cout << "swap " << tmp << " and " << nums[minIndex] << endl; nums[i] = nums[minIndex]; nums[minIndex] = tmp; } } int ans; if(n % 2 == 0){ ans = (nums[n/2] + nums[(n/2) - 1]) / 2; }else{ ans = nums[n/2]; } cout << ans << endl; return 0; }