#P1168. 中位数

中位数

Description

Given a non-negative integer sequence AA of length NN, find the median for each odd prefix.

Input Format

The first line contains a positive integer NN. The second line contains NN non-negative integers A1NA_{1\dots N}.

Output Format

There are N+12\lfloor \frac{N + 1}2\rfloor lines. The ii-th line is the median of A12i1A_{1\dots 2i - 1}.

7
1 3 5 7 9 11 6
1
3
5
6
7
3 1 5 9 8 7 6
3
3
5
6

Hint

For 20% of the testdata, N100N \le 100. For 40% of the testdata, N3000N \le 3000. For 100% of the testdata, 1N1000001 \le N \le 100000, 0Ai1090 \le A_i \le 10^9.

Translated by ChatGPT 5