#include<iostream> #include<algorithm> usingnamespacestd; long data[100001]; boolcmp(int a, int b) { return a < b ; } intmain(){ int N , p ; cin >> N >> p ; for(int i = 0 ; i< N ; i++) scanf("%ld",&data[i]); sort(data,data+N ,cmp); int max = 1 ; long cur ; for(int i = 0 ; i< N ; i++) { cur = data[i] * p; if(data[N-1] <= cur) { if(max <N-i) max = N - i; break ; } int low=i+1 , high =N ,mid ; while(low < high) { mid = (low+high)/2 ; if(data[mid] < cur) low = mid+1; elseif(data[mid] >cur) high = mid ; elseif(data[mid]==cur) { high = mid+1 ; break ; } } if( high - i > max) max = high - i ; } cout << max <<endl ; }