Love Median
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Love Median
Time limit: 1 seconds
Memory limit: 512 megabytes
Problem Statement
Median plays a very important role in mathematics. Frank has studied the median for a long time. Frank is dazed by a sequence . Frank thinks the problem of finding the median of sequence A is too easy. Now, he's going to make the problem a little bit hard.
First, in this problem, we define the median of a sorted sequence which length is as : .
Let be the length of sequence . For each pair , We make a new array with and sort it from small to large. Let be the median of the new array . We will list for all pairs to create a new sequence and sort it from small to large again. Find the median of .
Input
The first line contains one integers .
The second line contains integers denoting .
Output
Print a single integer, denoting the answer to the question.
3
10 30 20
30
10
5 9 5 9 8 9 3 5 4 3
8
Note
For the first example the new sequence is . The median of it after sort is .