C - Many Medians
Editorial
/


Time Limit: 2 sec / Memory Limit: 256 MB
配点 : 点
問題文
が奇数のとき, 個の数 の中央値とは, の中で 番目に大きい値のことを言います.
個の数 が与えられます.ここで, は偶数です. に対して, から のみを除いたもの,すなわち の中央値を とします.
に対して, を求めてください.
制約
- は偶数
- 入力はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
出力
行出力せよ. 行目には を出力せよ.
入力例 1Copy
Copy
4 2 4 4 3
出力例 1Copy
Copy
4 3 3 4
- の中央値は なので, です.
- の中央値は なので, です.
- の中央値は なので, です.
- の中央値は なので, です.
入力例 2Copy
Copy
2 1 2
出力例 2Copy
Copy
2 1
入力例 3Copy
Copy
6 5 5 4 4 3 3
出力例 3Copy
Copy
4 4 4 4 4 4
Score : points
Problem Statement
When is an odd number, the median of numbers is the -th largest value among .
You are given numbers , where is an even number. For each , let the median of excluding , that is, the median of be .
Find for each .
Constraints
- is even.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
...
Output
Print lines. The -th line should contain .
Sample Input 1Copy
Copy
4 2 4 4 3
Sample Output 1Copy
Copy
4 3 3 4
- Since the median of is , .
- Since the median of is , .
- Since the median of is , .
- Since the median of is , .
Sample Input 2Copy
Copy
2 1 2
Sample Output 2Copy
Copy
2 1
Sample Input 3Copy
Copy
6 5 5 4 4 3 3
Sample Output 3Copy
Copy
4 4 4 4 4 4