#ABC477B. 离群者 / Standing Outliers

离群者 / Standing Outliers

Problem Statement

There are NN people on a number line. The people are numbered 11 to NN, and person ii is at coordinate XiX_i. Multiple people may be at the same coordinate.

A person is said to "stand apart" if their distance to every other person is at least DD.

Formally, person ii is said to "stand apart" if ∣Xi−Xj∣≥D|X_i-X_j| \geq D holds for all j (1≤j≤N, j≠i)j ~ (1 \leq j \leq N,\ j \neq i).

Output the numbers of all people who "stand apart" in ascending order.

Constraints

  • 2≤N≤1002 \le N \le 100
  • 1≤D≤1091 \le D \le 10^9
  • 1≤Xi≤1091 \le X_i \le 10^9
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

  • NN DD
  • X1X_1 X2X_2 …\ldots XNX_N

Output

Let KK be the number of people who stand apart, and let (P1,P2,…,PK)(P_1,P_2,\dots,P_K) be the sequence of their numbers sorted in ascending order. Output them in the following format:

  • KK
  • P1P_1 P2P_2 …\ldots PKP_K

If K=0K=0, the second line should be empty.

3 3
1 5 7
1
1
  • Person 11 has distance 44 to person 22 and distance 66 to person 33, so their distance to every other person is at least DD. Thus, person 11 "stands apart".
  • Person 22 has distance 22 to person 33, so person 22 does not "stand apart".
  • Similarly, person 33 has distance 22 to person 22, so person 33 does not "stand apart" either.
  • Thus, only person 11 "stands apart".
3 2
1 1 1
0
  • There may be people at the same coordinate. Also, if no one "stands apart", the second line should be empty.
8 3
4 77 20 26 9 26 22 40
4
1 2 5 8
  • Output the numbers of the people who "stand apart" in ascending order.

  • Source: AtCoder ABC 477 B