Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int cnt[128];
- int divisors(int n)
- {
- for (int i=1; i<=sqrt(n); i++)
- {
- if (n%i==0)
- {
- if (n/i == i)
- cnt[i]++;
- else
- {
- cnt[n/i]++;
- }
- }
- }
- }
- int main()
- {
- int t;
- cin>>t;
- while(t--)
- {
- memset(cnt,0,sizeof(cnt));
- int n;
- cin>>n;
- int maxx=0;
- for(int i=0; i<n; i++)
- {
- int m;
- cin>>m;
- maxx=max(maxx,cnt[m]);
- divisors(m);
- }
- cout<<maxx<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement