https://pintia.cn/problem-sets/994805342720868352/problems/994805381845336064
#include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
const int N=1e5*2+10;
LL a[N],n,p;
int main(void)
{
cin>>n>>p;
for(int i=0;i<n;i++) cin>>a[i];
sort(a,a+n);
int ans=0;
for(int i=0,j=0;i<n;i++)
{
while(j<n&&a[j]*p<a[i]) j++;
ans=max(ans,i-j+1);
}
cout<<ans<<endl;
}