Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- void Warding()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- void solve()
- {
- ll n, Maxx = 0;
- cin >> n;
- vector<ll> v(n);
- for (auto &i : v)
- {
- cin >> i;
- }
- for (int i = 0; i < n - 1; i++)
- {
- ll x = ((v[i] * v[i + 1]) / __gcd(v[i], v[i + 1]));
- Maxx = max(Maxx, x);
- }
- cout << Maxx << endl;
- }
- int main()
- {
- Warding();
- int t;
- t = 1;
- // cin >> t;
- while (t--)
- {
- solve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment