本次采用two points的写法
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
const int maxn=100001;
int main()
{
int n,a[maxn];
LL m;
cin>>n>>m;
for (int i=0;i<n;i++)
scanf("%d",&a[i]);
LL temp;
sort(a,a+n);
int i=0,j=0,count =0;
while (i<n&&j<n)
{
temp=a[i]*m;
while (j<n&&temp>=a[j])
j++;
count =max(count,j-i);
i++;
}
printf("%d",count);
}