×

# 计蒜客

1. 题库
3. 问答
• 22.25%
• 262144K

XKC , the captain of the basketball team , is directing a train of $n$ team members. He makes all members stand in a row , and numbers them $1 \cdots n$ from left to right.

The ability of the $i$-th person is $w_i$ , and if there is a guy whose ability is not less than $w_i+m$ stands on his right , he will become angry. It means that the $j$-th person will make the $i$-th person angry if $j>i$ and $w_j \ge w_i+m$.

We define the anger of the $i$-th person as the number of people between him and the person , who makes him angry and the distance from him is the longest in those people. If there is no one who makes him angry , his anger is $-1$ .

Please calculate the anger of every team member .

### Input

The first line contains two integers $n$ and $m(2\leq n\leq 5*10^5, 0\leq m \leq 10^9)$ .

The following  line contain $n$ integers $w_1..w_n(0\leq w_i \leq 10^9)$ .

### Output

A row of $n$ integers separated by spaces , representing the anger of every member .

#### 样例输入

6 1
3 4 5 6 2 10

#### 样例输出

4 3 2 1 0 -1

• main.c