#include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N,S; cin>>N>>S; vectorP(N); vector>vp; for(int i=0;i>P[i]; vp.push_back(make_pair(P[i],i)); } sort(all(vp)); vectorid(N); for(int i=0;ians; for(int i=0;i0&&vp[id[i]-1].first>=P[i]-S)ok=true; if(id[i]