#include using namespace std; using P = pair; #ifdef _DEBUG #define show(x) \ cerr << #x << " : "; \ showVal(x) template void showVal(const T &a) { cerr << a << endl; } template void showVal(const pair &a) { cerr << a.first << " " << a.second << endl; } template void showVal(const vector &a) { for (const T &v : a) cerr << v << " "; cerr << endl; } template void showVal(const vector> &a) { cerr << endl; for (const pair &v : a) cerr << v.first << " " << v.second << endl; } template void showVal(const map &a) { cerr << endl; for (const auto &v : a) cerr << "[" << v.first << "] " << v.second << endl; } template void showVal(const vector> &a) { cerr << endl; for (const vector &v : a) showVal(v); } #else #define show(x) #endif int main() { int n, s; cin >> n >> s; vector p(n); for (int i = 0; i < n; i++) { cin >> p[i]; } set

m; for (int i = 0; i < n; i++) { m.insert({p[i], i}); } vector ans; for (auto [x, i] : m) { show(x); auto itr = m.find({x, i}); bool isok = true; for (auto v : {-1, 1}) { if (itr == m.begin() && v == -1) continue; auto pv = next(itr, v); if (pv == m.end()) continue; show(pv->first); if (abs((pv->first) - x) <= s) { isok = false; } } if (isok) { ans.push_back(i); } } sort(ans.begin(), ans.end()); cout << ans.size() << endl; int sz = ans.size(); for (int i = 0; i < sz; i++) { cout << ans[i] + 1; if (i == sz - 1) cout << endl; else cout << " "; } return 0; }