| Codeforces Round 1087 (Div. 2) |
|---|
| Finished |
You are given an integer array $$$a$$$ of length $$$n$$$.
For each index $$$i$$$, find the maximum number of indices $$$j$$$ such that $$$j \gt i$$$ and $$$|a_i - k| \gt |a_j - k|$$$, over all possible integer values of $$$k$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). The description of the test cases follows.
The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 5000$$$).
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$-10^9 \le a_i \le 10^9$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$5000$$$.
For each test case, output $$$n$$$ integers denoting the answer.
6110922105 -10551 2 93 84 272 9 38 4 7 1 6101 9 20 9 829 3 87 1 283 7119 18 29817 283 3 3928 5726 1942 1000000000 -1000000000 19
01 04 2 2 1 05 4 4 2 2 1 08 4 4 3 5 3 2 2 1 08 7 7 4 5 3 3 2 2 1 0
In the second test, the answers are:
In the third test, the answers are:
| Name |
|---|


