#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include using namespace std; #if __has_include() #include using namespace atcoder; #endif #ifdef LOCAL #include "algo/debug.hpp" #else #define debug(...) void(0) #endif constexpr int inf=0x3fffffff; constexpr long long linf=0xfffffffffffffff; using ll = long long; using ull = unsigned long long; using ld = long double; using vi = vector; using vl = vector; template using vc = vector; template using vvc = vector>; template using vvvc = vector>; template using vvvvc = vector>; template using pq = priority_queue; //max template using pqg = priority_queue, greater>; //min #define len(x) int((x).size()) #define overload4(a,b,c,d,name,...) name #define overload5(a,b,c,d,e,name,...) name #define rep1(n) for(ll _=0;_ name(__VA_ARGS__) #define vv(type,name,h,...) vector> name(h,vector(__VA_ARGS__)) #define vvv(type,name,h,w,...) vector>> name(h,vector(w,vector(__VA_ARGS__))) #define vvvv(type, name, h, w, n, ...) vector>>> name(h, vector>>(w, vector>(n, vector(__VA_ARGS__)))) template inline bool chmax(T& a, const S& b) { return (a < b ? a = b, 1 : 0); } template inline bool chmin(T& a, const S& b) { return (a > b ? a = b, 1 : 0); } template void UNIQUE(T& a){ sort(all(a)); a.erase(unique(all(a)), a.end()); } struct Setting{ Setting(){ cin.tie(nullptr)->sync_with_stdio(0); fixed(cout).precision(12); } }Setting; //----------------------------------- int main() { int N, S; cin >> N >> S; vector> P(N); rep(i, N) cin >> P[i].first, P[i].second = i + 1; if(N == 1) { cout << 1 << endl; cout << 1 << endl; return 0; } sort(all(P)); vector ans; rep(i, N) { if(i == 0) { if(P[i+1].first - P[i].first > S) ans.push_back(P[i].second); }else if(i == N - 1) { if(P[i].first - P[i-1].first > S) ans.push_back(P[i].second); }else { if(P[i + 1].first - P[i].first > S && P[i].first - P[i-1].first > S) ans.push_back(P[i].second); } } cout << len(ans) << endl; sort(all(ans)); for(auto&&a: ans) { cout << a << " "; }cout << endl; }