- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagain.cpp
More file actions
Latest commit
51 lines (43 loc) · 1.1 KB
/
Copy pathagain.cpp
File metadata and controls
51 lines (43 loc) · 1.1 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<bits/stdc++.h>
usingnamespacestd;
using ll = longlong;
using ld = longdouble;
using ull = unsignedlonglong;
#defineendl'\n'
#definesz(x) (int)x.size()
#defineall(x) (x).begin(),(x).end()
#definerall(x) (x).rbegin(),(x).rend()
#defineprec(x) fixed << setprecision(x)
#definetestcase cout << "Case " << cs++ << ":"
//stol(s);sqrtl() to_string(x);
template <typename T>
using minHeap = priority_queue<T, vector<T>, greater<T>>;
const ld PI = acos((ld) - 1);
constintMOD = 1e9 + 7;
const ll INF = 2e18 + 1;
const ld EPS = 1e-9;
constintMX = 2e6;
int cs = 1;
voidsolve(){
int n; cin >> n;
vector <int> v(n);
for(int &it : v) cin >> it;
vector <ll> vv;
for(int i = 0; i < n; i++){
for(int j = i+1; j < n; j++) vv.push_back(lcm(v[i], v[j]));
}
ll g = 0;
for(int i = 0; i < sz(vv); i++) g = gcd(g, vv[i]);
cout << g << endl;
}
intmain() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
//cin >> t;
//cin.ignore();
while (t--) {
solve();
}
return0;
}