2644Median

2644   Median

题目描述

Given an array A whose size is n, please find the median number.Median number is n/2th number in array A after A is sorting.

输入格式:

The first line contains one integer T, indicates the total test cases. Each test case contains one integer n. Next line contains n numbers ai.Index of array starts with 0.

(1<=n<=1000,T<=20,|ai|<=109)

输出格式:

Print answer each line

输入样例 复制
2
4
3 2 1 4
1
5
输出样例 复制
3
5

说明

22
34
通过提交
时空限制1000ms/128mb
题目来源数据结构实验与竞赛训练
评测方式在线评测
题目类型
难        度