#include #include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); }; } fio; signed main(){ cout< A, B; cin>>N>>D; A.resize(N); B.resize(N); for(int i = 0; i < N; i++){ cin>>A[i]; B[i] = A[i]; } sort(A.begin(), A.end()); for(int i = 0; i < N; i++){ int c = upper_bound(A.begin(), A.end(), B[i] - D) - A.begin(); cout<