package yukicorder; import java.util.Scanner; public class QNo275 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); short n = sc.nextShort(); short[] a = new short[n+1]; short[] out = new short[n+1]; a[0] = -10000; out[0] = -10000; for(int i=1;i<=n;i++){ a[i] = sc.nextShort(); } for(short i =n;i>0;i--){ partHeap(i,a); } for(short k=n;k>1;k--){ out[k] = a[1]; a[1] = a[k]; a[k] = -10000; partHeap((short)1,a); } double center = -10000; if(n%2==0) center = (double)(out[n/2] + out[n/2+1])/2; else center = out[n/2+1]; System.out.println(center); } private static void partHeap(short parent,short[] a){ short cand = -10000; short lr = -1; short pare = -10000; try{ pare = a[parent]; cand = a[parent*2]; lr = 0; if(cand pare){ a[parent] = cand; a[parent*2+lr] = pare; partHeap((short)(parent*2+lr),a); } } }