#include<stdio.h>
#include<algorithm>
using namespace std;
int aa[100010]={0};
int main(){
int i, j, n, p, m, M, left, right, mid, ans=1;
scanf("%d%d",&n,&p);
for(i=0;i<n;i++)scanf("%d",&aa[i]);
sort(aa,aa+n);
for(i=0;i<n;i++){
long long ll=aa[i]*p;
j=upper_bound(aa+i+1,aa+n,(long long)aa[i]*p)-aa;
ans=max(ans,j-i);
}
printf("%d\n",ans);
return 0;
}
PAT-B1030
最新推荐文章于 2020-06-10 15:41:21 发布