#include <cstdio>
#include <algorithm>
using namespace std;
const int N=100010;
long long a[N];
bool cmp(long long a,long long b){
return a<b;
}
int main(){
int n;
long long p;
scanf("%d%lld",&n,&p);
for (int i = 0; i <n ; ++i) {
scanf("%lld",&a[i]);
}
sort(a,a+n,cmp);
int result=0,temp;
for (int i = 0; i <n ; ++i) {
for (int j = i+result; j <n ; ++j) {
if(a[j]<=a[i]*p){
temp = j-i+1;
if(temp>result) {
result = temp;
}
} else{
break;
}
}
}
printf("%d",result);
return 0;
}
1030乙级,完美数列
最新推荐文章于 2021-07-14 17:36:41 发布