#pragma GCC target ("avx") #pragma GCC optimization ("Ofast") #pragma GCC optimization ("unroll-loops") #include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, d; cin >> n >> d; int a[200000]; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { int ans = 0; for (int j = 0; j < n; j++) { if (a[i] - a[j] >= d) ans++; } cout << ans << "\n"; } }