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: 1124ms
Memory: 39204kB
Author: 2017212212207
In contest: 1260

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
using namespace std;
typedef long long LL;
int n, k;
LL a[100005];
map<LL, int>mmp;
map<LL, int>::iterator it;
int main()
{
	scanf("%d %d", &n, &k);
	for(int i = 1; i <= n;i++)
	{
		scanf("%lld", &a[i]);
	}
	sort(a+1,a+1+n);
	for(int i = 1;i<=k;i++)
	{
		for(int j=1;j<=n;j++)
		{
			if(a[j]%i==0)mmp[a[j]/i]++;
		}
	}
	int maxx = 0;
	for(it = mmp.begin();it!=mmp.end();it++)
	{
		if(it->second>maxx)maxx = it->second;
	}
	printf("%d\n", maxx);
	return 0;
}