-
Notifications
You must be signed in to change notification settings - Fork 1
/
10360_CS_Clubs.cpp
38 lines (33 loc) · 1022 Bytes
/
10360_CS_Clubs.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Problem#: 10360
// Submission#: 2746276
// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
#include <cstdio>
#include <algorithm>
using namespace std;
long long countf[2000010];
int main(){
int N;
scanf("%d",&N);
long long maxf = 0;
for(int i = 0;i < N;i ++){
int t;
scanf("%d",&t);
for(int j = 1;j * j <= t;j ++){
if(t % j == 0){
countf[j] ++;
if(countf[j] > 1){
maxf = max(maxf,countf[j] * j);
}
if(j* j != t){
countf[t/j] ++;
if(countf[t/j] > 1){
maxf = max(maxf,countf[t/j] * (t/j));
}
}
}
}
}
printf("%lld\n",maxf);
}