PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#CC0000066. Nhảy qua những cột trụ (E - Pillars)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Nhảy qua những cột trụ (E - Pillars)

E - Pillars

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn pillars of heights hih_i. A jump may only go from a smaller index ii to a larger index jj, and is allowed when ∣hi−hj∣≥d|h_i-h_j|\ge d. Find a maximum-length sequence of visited pillars and print one optimal sequence of indices.

Input

The first line contains n,dn,d. The second contains nn heights hih_i.

Output

Print the maximum length LL on the first line and any optimal strictly increasing sequence of LL 1-based indices on the second line.

Subtasks

Original constraints: 1≤n≤1051\le n\le10^5; 0≤d≤1090\le d\le10^9; 1≤hi≤10151\le h_i\le10^{15}.

  • Subtask 1 (20 points): 1≤n≤151\le n\le15; 0≤d≤500\le d\le50; 1≤hi≤501\le h_i\le50.
  • Subtask 2 (30 points): 1≤n≤20001\le n\le2000; 0≤d≤10000000\le d\le1000000; 1≤hi≤10000001\le h_i\le1000000.
  • Subtask 3 (50 points): 1≤n≤1000001\le n\le100000; 0≤d≤10000000000\le d\le1000000000; 1≤hi≤10000000000000001\le h_i\le1000000000000000.

Examples

Input

5 2
1 3 6 7 4

Output

4
1 2 3 5

Explanation

Positions 1,2,3,51,2,3,5 have heights 1,3,6,41,3,6,4, with differences 2,3,22,3,2. This is an optimal sequence of length 44; other optimal sequences are accepted.