Language: C++

/*
░░░░░░░░░░░░░░░░▄▄█▀▀██▄▄░░░░░░░
░░░░░░░░░░░░░▄█▀▀░░░░░░░▀█░░░░░░
░░░░░░░░░░░▄▀░░░░░░░░░░░░░█░░░░░
░░░░░░░░░▄█░░░░░░░░░░░░░░░█░░░░░
░░░░░░░██▀░░░░░░░▄▄▄░░▄░█▄█▄░░░░
░░░░░▄▀░░░░░░░░░░████░█▄██░▀▄░░░
░░░░█▀░░░░░░░░▄▄██▀░░█████░██░░░
░░░█▀░░░░░░░░░▀█░▀█▀█▀▀▄██▄█▀░░░
░░░██░░░░░░░░░░█░░█░█░░▀▀▄█▀░░░░
░░░░█░░░░░█░░░▀█░░░░▄░░░░░▄█░░░░
░░░░▀█░░░░███▄░█░░░░░░▄▄▄▄█▀█▄░░
░░░░░▀██░░█▄▀▀██░░░░░░░░▄▄█░░▀▄░
░░░░░░▀▀█▄░▀▄▄░▄░░░░░░░███▀░░▄██/*
░░░░░░░░░░░░░░░░▄▄█▀▀██▄▄░░░░░░░
░░░░░░░░░░░░░▄█▀▀░░░░░░░▀█░░░░░░
░░░░░░░░░░░▄▀░░░░░░░░░░░░░█░░░░░
░░░░░░░░░▄█░░░░░░░░░░░░░░░█░░░░░
░░░░░░░██▀░░░░░░░▄▄▄░░▄░█▄█▄░░░░
░░░░░▄▀░░░░░░░░░░████░█▄██░▀▄░░░
░░░░█▀░░░░░░░░▄▄██▀░░█████░██░░░
░░░█▀░░░░░░░░░▀█░▀█▀█▀▀▄██▄█▀░░░
░░░██░░░░░░░░░░█░░█░█░░▀▀▄█▀░░░░
░░░░█░░░░░█░░░▀█░░░░▄░░░░░▄█░░░░
░░░░▀█░░░░███▄░█░░░░░░▄▄▄▄█▀█▄░░
░░░░░▀██░░█▄▀▀██░░░░░░░░▄▄█░░▀▄░
░░░░░░▀▀█▄░▀▄▄░▄░░░░░░░███▀░░▄██
░░░░░░░░░▀▀▀███▀█▄░░░░░█▀░▀░░░▀█
░░░░░░░░░░░░▄▀░░░▀█▄░░░░░▄▄░░▄█▀
░░░▄▄▄▀▀▀▀▀█▀░░░░░█▄▀▄▄▄▄▄▄█▀▀░░
░▄█░░░▄██▀░░░░░░░░░█▄░░░░░░░░░░░
█▀▀░▄█░░░░░░░░░░░░░░▀▀█▄░░░░░░░░
█░░░█░░░░░░░░░░░░░░░░░░█▄░░░░░░░
*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define x first
#define y second
#define pi pair <int, int>
#define vi vector <int>
const ll mod = 998244353;
//#define int ll
int n, m, a[100002];

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    cin>>n;
    for(int i=1; i<=n; i++) cin>>a[n-i+1];
    int l=2, r=3;
    if(a[1]==1) r=2;
    if(a[1]>2) return cout<<-1, 0;
    for(int i=2; i<=n; i++){
       // if(a[i]>r) return cout<<-1, 0;
        int xd=a[i];
        l=((l+xd-1)/xd)*xd;
        r=r-(r%xd)+xd-1;
        if(l>r) return cout<<-1, 0;
    }
    cout<<l<<" "<<r;
}

░░░░░░░░░▀▀▀███▀█▄░░░░░█▀░▀░░░▀█
░░░░░░░░░░░░▄▀░░░▀█▄░░░░░▄▄░░▄█▀
░░░▄▄▄▀▀▀▀▀█▀░░░░░█▄▀▄▄▄▄▄▄█▀▀░░
░▄█░░░▄██▀░░░░░░░░░█▄░░░░░░░░░░░
█▀▀░▄█░░░░░░░░░░░░░░▀▀█▄░░░░░░░░
█░░░█░░░░░░░░░░░░░░░░░░█▄░░░░░░░
*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define x first
#define y second
#define pi pair <int, int>
#define vi vector <int>
const ll mod = 998244353;
//#define int ll
int n, m, a[100002];

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    cin>>n;
    for(int i=1; i<=n; i++) cin>>a[n-i+1];
    int l=2, r=3;
    if(a[1]!=2) return cout<<-1, 0;
    for(int i=2; i<=n; i++){
       // if(a[i]>r) return cout<<-1, 0;
        int xd=a[i];
        l=((l+xd-1)/xd)*xd;
        r=r-(r%xd)+xd-1;
        if(l>r) return cout<<-1, 0;
    }
    cout<<l<<" "<<r;
}


Compiler output:
a.cc:65:1: error: extended character ░ is not valid in an identifier
   65 | ░░░░░░░░░▀▀▀███▀█▄░░░░░█▀░▀░░░▀█
      | ^
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ▀ is not valid in an identifier
a.cc:65:1: error: extended character ▀ is not valid in an identifier
a.cc:65:1: error: extended character ▀ is not valid in an identifier
a.cc:65:1: error: extended character █ is not valid in an identifier
a.cc:65:1: error: extended character █ is not valid in an identifier
a.cc:65:1: error: extended character █ is not valid in an identifier
a.cc:65:1: error: extended character ▀ is not valid in an identifier
a.cc:65:1: error: extended character █ is not valid in an identifier
a.cc:65:1: error: extended character ▄ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character █ is not valid in an identifier
a.cc:65:1: error: extended character ▀ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ▀ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ░ is not valid in an identifier
a.cc:65:1: error: extended character ▀ is not valid in an identifier
a.cc:65:1: error: extended character █ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
   66 | ░░░░░░░░░░░░▄▀░░░▀█▄░░░░░▄▄░░▄█▀
      | ^
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ▄ is not valid in an identifier
a.cc:66:1: error: extended character ▀ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ▀ is not valid in an identifier
a.cc:66:1: error: extended character █ is not valid in an identifier
a.cc:66:1: error: extended character ▄ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ▄ is not valid in an identifier
a.cc:66:1: error: extended character ▄ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ░ is not valid in an identifier
a.cc:66:1: error: extended character ▄ is not valid in an identifier
a.cc:66:1: error: extended character █ is not valid in an identifier
a.cc:66:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
   67 | ░░░▄▄▄▀▀▀▀▀█▀░░░░░█▄▀▄▄▄▄▄▄█▀▀░░
      | ^
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character █ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character █ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character ▄ is not valid in an identifier
a.cc:67:1: error: extended character █ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ▀ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:67:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
   68 | ░▄█░░░▄██▀░░░░░░░░░█▄░░░░░░░░░░░
      | ^
a.cc:68:1: error: extended character ▄ is not valid in an identifier
a.cc:68:1: error: extended character █ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ▄ is not valid in an identifier
a.cc:68:1: error: extended character █ is not valid in an identifier
a.cc:68:1: error: extended character █ is not valid in an identifier
a.cc:68:1: error: extended character ▀ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character █ is not valid in an identifier
a.cc:68:1: error: extended character ▄ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:68:1: error: extended character ░ is not valid in an identifier
a.cc:69:1: error: extended character █ is not valid in an identifier
   69 | █▀▀░▄█░░░░░░░░░░░░░░▀▀█▄░░░░░░░░
      | ^
a.cc:69:1: error: extended character ▀ is not valid in an identifier
a.cc:69:1: error: extended character ▀ is not valid in an identifier
a.cc:69:1: error: extended character ░ is not valid in an identifier
a.cc:69:1: error: extended character ▄ is not valid in an identifier
a.cc:69:1: error: extended character █ is not valid in an identifier
a.cc:69:1: error: extended character ░ is not valid in an identifier
a.cc:69:1: error: extended character ░ is not valid in an identifier
a.cc:69:1: