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: 1641ms
Memory: 39200kB
Author: 2017212212145
In contest: 1260

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<queue>
#include<map>
#include<set>
using namespace std;
#define inf 0x3f3f3f3f
#define mm(a,b) memset(a,b,sizeof(a))
#define MAXN 100010
#define ll long long
const ll mod=10092272478850909;
int n,k;
long long a[MAXN];
map<long long,int>dp;
int main()
{
	int ans=0;
	long long ma=0;
	scanf("%d%d",&n,&k);
	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) { dp[a[i]/j]++; ans=max(ans,dp[a[i]/j]); }
		}
	}
	printf("%d\n",ans);
}