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]; short[] out = new short[n]; for(int i=0;i0;i--){ partHeap((short)(i-1),a); } for(short k=n;k>1;k--){ out[k-1] = a[0]; a[0] = a[k-1]; a[k-1] = -10000; partHeap((short)0,a); } double center = -10000; if(n%2==0) center = (a[n/2] + a[n/2+1])/2; else center = a[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); } } }