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: 1433ms
Memory: 39984kB
Author: 2017212212217
In contest: 1260

#include<iostream>
#include<algorithm>
#include<string.h>
#include<cmath>
#include<cstdio>
#include<map>
using namespace std;
long long int a[100005];
long long int ss[100005];
map<long long int,long long int>mp1;
int main()
{
	int n,k;
	scanf("%d%d",&n,&k);
	int vew=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&a[i]);
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=k;j++)
		{
			if(a[i]%j==0)
			{
				mp1[a[i]/j]++;
			}
		}
	}
	long long int ans=0;
	map<long long int,long long int>::iterator q;
	for(q=mp1.begin();q!=mp1.end();q++)
	{
		ans=max(ans,q->second);
	}
	printf("%lld\n",ans);
}