function Main(input) { // inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。 var data = input.split("\n") const n = parseInt(data[0]) const array = data[1].split(' ').map(item => parseInt(item)) array.sort((a,b) => a < b ? - 1 : 1) if (n % 2 != 0) { console.log(array[(Math.floor(n/2))]) } else { const res = (array[n/2-1] + array[n/2]) / 2 console.log(res) } } // Don't edit this line! Main(require("fs").readFileSync("/dev/stdin", "utf8"));