#include using namespace std; #ifndef ONLINE_JUDGE #include "algo/debug.h" #define debug(x...) cerr << "[" << #x << "] = ["; _print(x) #else #define debug(x...) #endif #define int long long void solve() { int n, s; cin >> n >> s; vector> a; for (int i = 0, x; i < n; i++) { cin >> x; a.push_back({x, i + 1}); } sort(a.begin(), a.end()); vector ans; for (int i = 0; i < n; i++) { bool ok = 1; if (i) { if (a[i].first - a[i - 1].first <= s) { ok = false; } } if (i < n - 1) { if (a[i + 1].first - a[i].first <= s) { ok = false; } } if (ok) { ans.push_back(a[i].second); } } sort(ans.begin(), ans.end()); cout << ans.size() << '\n'; for (auto &x : ans) { cout << x << " "; } } signed main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #else #endif ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t = 1; //cin >> t; while (t--) { solve(); } // cerr << "Time elapsed: " << ((long double)clock() / CLOCKS_PER_SEC) << " s.\n"; }