Start: Feb, 20, 2019 12:00:00
2018-2019 ACM集训队冬季集训第一次考核
End: Feb, 20, 2019 17:00:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 1733ms
Memory: 38424kB
Author: 2017212212065
In contest: 1260

#include<iostream>
#include<cstdio>
#include<map>

using namespace std;
map<long long,int>mp;
int main(void){
	long long a, b, c, i, maxx = 0;
	scanf("%lld %lld",&a,&b);
	while(a--){
		scanf("%lld",&c);
		mp[c]++;
		if(mp[c] > maxx){
			maxx = mp[c];
		}
		for(i = 2;i <= b;i++){
			if(c % i == 0){
				mp[c / i]++;
				if(mp[c / i] > maxx){
					maxx = mp[c / i];
				}
			}
		}
	}
	printf("%lld\n",maxx);
	return 0;
}