#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; using ll = long long; void solve() { int N; ll K; cin >> N >> K; ll ans = 0; vector a(N+1); a[N] = 1<<30; for( int i = 0; i < N; i++ ) { cin >> a[i]; } sort(a.begin(),a.end()); for( int i = 0; i < N; i++ ) { ll j = lower_bound(a.begin(),a.end(),(2*K+a[i]-1)/a[i])-a.begin(); ans += N-j; } cout << ans << "\n"; } int main() { int t = 1; while( t > 0 ) { solve(); t--; } }