criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        System.out.printn((A-B)%2==0 ? "Alice" : "Borys");
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        System.out.printn((A-B)%2==0 ? "Alice" : "Borys");
                  ^
  symbol:   method printn((A - B) % [...]orys")
  location: variable out of type PrintStream
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;

int i,j,k,n,t;

int main(){
	scanf("%d %d %d", &n,&a, &b);
	if((b-a)%2==0){
		puts("Alice");
	}
	else{
		puts("Borys");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: 'a' was not declared in this scope
   16 |         scanf("%d %d %d", &n,&a, &b);
      |                               ^
a.cc:16:35: error: 'b' was not declared in this scope
   16 |         scanf("%d %d %d", &n,&a, &b);
      |                                   ^
Language: C++

#include <bits/stdc++.h>
typedef long long int ll;
#define FOR(i, a, b) for (ll i = (signed)(a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EREP(i, n) for (int i = (n)-1; i >= 0; --i)
#define MOD 1000000007
#define pb push_back
#define INF 93193111451418101
#define MIN -93193111451418101
#define EPS 1e-11
#define tp(a, b, c) make_tuple(a, b, c)
#define lb(a, b) lower_bound((a).begin(), (a).end(), (b))
#define ub(a, b) upper_bound((a).begin(), (a).end(), (b))
#define bitcnt(a) (ll) __builtin_popcount((a))
using namespace std;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef pair<ll, P> TP;
template <typename T> void fill_all(T &arr, const T &v) { arr = v; }
template <typename T, typename ARR> void fill_all(ARR &arr, const T &v) {
  for (auto &i : arr) {
    fill_all(i, v);
  }
}
//------------------変数-----------------------//
ll n;
//-------------------関数----------------------//
int main() {
  ll a, b;
  cin >> n >> a >> b;
  if (abs(a - v) % 2 == 1) {
    cout << "Borys" << endl;
  } else {
    cout << "Alice" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'v' was not declared in this scope
   31 |   if (abs(a - v) % 2 == 1) {
      |               ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;

int i,j,k,n,t;

int main(){
	scanf("%d %d %d", &n,&a, &b);
	if((b-a)%2==1){
		puts("Alice");
	}
	else{
		puts("Borys");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: 'a' was not declared in this scope
   16 |         scanf("%d %d %d", &n,&a, &b);
      |                               ^
a.cc:16:35: error: 'b' was not declared in this scope
   16 |         scanf("%d %d %d", &n,&a, &b);
      |                                   ^
Language: Java

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        System.out.printn((A-B)%2==0 ? "Alice" : "Borys")
    }
}

Compiler output:
Main.java:11: error: ';' expected
        System.out.printn((A-B)%2==0 ? "Alice" : "Borys")
                                                         ^
1 error
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,a,b
int main(){
  cin>>n>>a>>b;
  if(abs(a-b)%2==0)cout<<"Alice"<<endl;
  else cout<<"Borys"<<endl;
}


Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int main(){
      | ^~~
Language: C++

void main() {
  cout << "Alice" << endl;
}

Compiler output:
a.cc:1:1: error: '::main' must return 'int'
    1 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:3: error: 'cout' was not declared in this scope
    2 |   cout << "Alice" << endl;
      |   ^~~~
a.cc:2:22: error: 'endl' was not declared in this scope
    2 |   cout << "Alice" << endl;
      |                      ^~~~
Language: C

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n, a, b;
	cin >> n >> a >> b;
	cout << ((b - a) % 2 ? "Borys" : "Alice") << endl;
	return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include "bits/stdc++.h"
using namespace std;

int main(){
	int n,a,b;
	cin>>n>>a>>b;
	if(n==2){
		cout<<"Borys"<<endl;
	}
	}
	if((a-1)<=(n-b)){
		cout<<"Alice"<<endl;
	}else{
		cout<<"Borys"<<endl;
	}
	
}

Compiler output:
a.cc:11:9: error: expected unqualified-id before 'if'
   11 |         if((a-1)<=(n-b)){
      |         ^~
a.cc:13:10: error: expected unqualified-id before 'else'
   13 |         }else{
      |          ^~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>	
#include <time.h>
#include <vector>
#include <stdio.h>
#include <memory.h>
#include <string>
#include <string.h>
#include <map>
#include <algorithm>
#include <bitset>
#include <queue>
#include <set>
#include <time.h>
#include <assert.h>
#include <sstream>
//#include <unordered_map>
#include <bitset>
#include <utility>
#include <iomanip>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <math.h>
#include <cmath>
#include <complex>
#if !ONLINE_JUDGE
#include "inc.h"
#endif
using namespace std;
typedef long long ll;


int main() {
#if !ONLINE_JUDGE
	freopen("a.txt", "r", stdin);
	//freopen("a.txt", "w", stdout);
	decTime;
#endif

	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	printf("%s\n", abs(a - b) & 1 ? "Borys" : "Alice");


#if !ONLINE_JUDGE
	printTime;
#endif
	return 0;
}

Compiler output:
a.cc:30:10: fatal error: inc.h: No such file or directory
   30 | #include "inc.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int A =scan.nextInt();
        int B = scan.nextInt();

        if(Math.abs(A-B)%2 == 1){
            System.out.println("Borys");
        }else{
            System.out.println("Alice");
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:16:2: error: expected ';' after class definition
   16 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:9: error: 'Scanner' was not declared in this scope
    5 |         Scanner scan = new Scanner(System.in);
      |         ^~~~~~~
a.cc:6:17: error: 'scan' was not declared in this scope
    6 |         int N = scan.nextInt();
      |                 ^~~~
a.cc:10:12: error: 'Math' was not declared in this scope
   10 |         if(Math.abs(A-B)%2 == 1){
      |            ^~~~
a.cc:11:13: error: 'System' was not declared in this scope
   11 |             System.out.println("Borys");
      |             ^~~~~~
a.cc:13:13: error: 'System' was not declared in this scope
   13 |             System.out.println("Alice");
      |             ^~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
typedef long long li;
//#define ceil(a,b) (((a)+(b)-1)/(b))
li ceil(li a,li b){
  return a/b+(a%b?1:0);
}
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

int main(){
  li n; cin >>n;
  vector<li> a(n);rep(i,n) cin >>a[i];
  if(a[i]!=2){
    print(-1);
    return 0;
  }
  li mi=2,ma=4;
  rep(_i,n){
    int i=n-1-_i;
    mi=ceil(mi,a[i])*a[i];
    ma=ceil(ma,a[i])*a[i];
  }
  if(mi==ma) print(-1);
  else print(mi,ma-1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: 'i' was not declared in this scope
   17 |   if(a[i]!=2){
      |        ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
typedef long long li;
#define ceil(a,b) (((a)+(b)-1)/(b))
li ceil(li a,li b){
  return a/b+(a%b?1:0);
}
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

int main(){
  li n; cin >>n;
  vector<li> a(n);rep(i,n) cin >>a[i];
  li mi=2,ma=4;
  rep(_i,n){
    int i=n-1-_i;
    mi=ceil(mi,a[i])*a[i];
    ma=ceil(ma,a[i])*a[i];
  }
  if(mi==ma) print(-1);
  else print(mi,ma-1);
}


Compiler output:
a.cc:6:12: error: expected ')' before 'a'
    6 | li ceil(li a,li b){
      |            ^
a.cc:5:22: note: in definition of macro 'ceil'
    5 | #define ceil(a,b) (((a)+(b)-1)/(b))
      |                      ^
a.cc:5:21: note: to match this '('
    5 | #define ceil(a,b) (((a)+(b)-1)/(b))
      |                     ^
a.cc:6:4: note: in expansion of macro 'ceil'
    6 | li ceil(li a,li b){
      |    ^~~~
a.cc:6:12: error: expected ')' before 'a'
    6 | li ceil(li a,li b){
      |            ^
a.cc:5:22: note: in definition of macro 'ceil'
    5 | #define ceil(a,b) (((a)+(b)-1)/(b))
      |                      ^
a.cc:5:20: note: to match this '('
    5 | #define ceil(a,b) (((a)+(b)-1)/(b))
      |                    ^
a.cc:6:4: note: in expansion of macro 'ceil'
    6 | li ceil(li a,li b){
      |    ^~~~
a.cc:6:12: error: expected ')' before 'a'
    6 | li ceil(li a,li b){
      |            ^
a.cc:5:22: note: in definition of macro 'ceil'
    5 | #define ceil(a,b) (((a)+(b)-1)/(b))
      |                      ^
a.cc:5:19: note: to match this '('
    5 | #define ceil(a,b) (((a)+(b)-1)/(b))
      |                   ^
a.cc:6:4: note: in expansion of macro 'ceil'
    6 | li ceil(li a,li b){
      |    ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9+7;
const ll inf_l = 1e18;
const int MAX = 1e6;

ll ans_mx = 0;
ll ans_mn = inf_l;
vll a;
int k;

bool dfs(int v, ll now) {
    if (v == k-1) {
        ans_mx = max(ans_mx,now+a[v]-1);
        ans_mn = min(ans_mn,now);
        return;
    }
    for (ll i = ((now+a[v+1]-1)/a[v+1])*a[v+1]; i < now+a[v]; i += a[v+1]) {
        dfs(v+1,i);
    }
}


int main() {
    cin >> k;
    a.resize(k);
    rep(i,k) cin >> a[i];
    reverse(all(a));
    if (a[0] != 2) {cout << -1 << endl; return 0;}
    dfs(0,2);
    if (ans_mn != inf_l && ans_mx != 0) {
        cout << ans_mn << " " << ans_mx << endl;
    } else {
        cout << -1 << endl;
    }
}

Compiler output:
a.cc: In function 'bool dfs(int, ll)':
a.cc:29:9: error: return-statement with no value, in function returning 'bool' [-fpermissive]
   29 |         return;
      |         ^~~~~~
a.cc:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9+7;
const ll inf_l = 1e18;
const int MAX = 1e6;

ll ans_mx = 0;
ll ans_mn = inf_l;
vll a;
int k;

bool dfs(int v, ll now) {
    if (v == k-1) {
        ans_mx = max(ans_mx,now+a[v]-1);
        ans_mn = min(ans_mn,now);
        return;
    }
    for (ll i = ((now+a[v+1]-1)/a[v+1])*a[v+1]; i < now+a[v]; i += a[v+1]) {
        dfs(v+1,i)
    }
}


int main() {
    cin >> k;
    a.resize(k);
    rep(i,k) cin >> a[i];
    reverse(all(a));
    if (a[0] != 2) {cout << -1 << endl; return 0;}
    dfs(0,2);
    if (ans_mn != inf_l && ans_mx != 0) {
        cout << ans_mn << " " << ans_mx << endl;
    } else {
        cout << -1 << endl;
    }
}

Compiler output:
a.cc: In function 'bool dfs(int, ll)':
a.cc:29:9: error: return-statement with no value, in function returning 'bool' [-fpermissive]
   29 |         return;
      |         ^~~~~~
a.cc:32:19: error: expected ';' before '}' token
   32 |         dfs(v+1,i)
      |                   ^
      |                   ;
   33 |     }
      |     ~              
a.cc:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
Language: C++

//
// Created by 榊原章之 on 2020/06/07.
//

#include <iostream>
#include <vector>
#include  <cmath>
using namespace std;
using ll = int64_t;


ll reverse_game_max(ll i, const vector<ll>& as, ll n_i) {
  i--;
  if (n_i % as[i] != 0 ) {
    return -1;
  }
  if (i == 0) {
    ll num = n_i + as[0] - 1;
    return num;
  } else {
    for (ll j=as[i]-1; j>=0; j--) {
      if ((n_i + j) % as[i-1] == 0) {
        return reverse_game_max(i, as, n_i + j);
      }
    }
    return -1;
  }
}

ll reverse_game_min(ll i, const vector<ll>& as, ll n_i) {
  i--;
  if (n_i % as[i] != 0 ) {
    return -1;
  }
  if (i == 0) {
    return n_i;
  } else {
    for (ll j=0; j<as[i]; j++) {
      if ((n_i + j) % as[i-1] == 0) {
        return reverse_game_min(i, as, n_i + j);
      }
    }
    return -1;
  }
}

ll main() {
  ll k;
  cin >> k;
  if (k < 1 || pow(10, 5) < k) {
    cout << "-1";
    return 0;
  }
  vector<ll> a(k);
  for (auto & z : a) {
    cin >> z;
  }
  for (auto & z : a) {
    if (z < 2 || pow(10, 9) < z ) {
      cout << "-1";
      return 0;
    }
  }

  ll mini = reverse_game_min(k, a, 2);
  auto maxi = reverse_game_max(k, a, 2);
  if (mini < 0 || maxi < 0)
    cout << "-1";
  else
    cout << reverse_game_min(k, a, 2) << " " << reverse_game_max(k, a, 2);

  return 0;
}


Compiler output:
a.cc:47:1: error: '::main' must return 'int'
   47 | ll main() {
      | ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define F  first
#define S  second
#define ff(i,n) for(i=0;i<n;i++)
ll bg = 1000000007;
ll power(ll x,ll y)
{
	if(y==0)
		return 1;
	ll h=power(x,y/2)%bg;	
	h=(h*h)%bg;
	if(y%2==1)
	  return (x*h)%bg;
	else
	  return h%bg;  
}
ll modinv(ll m)
{
	return power(m,bg-2)%bg;
}
vector<ll> z_func(vector<ll> a)
{
	ll n = a.size();
	vector<ll> z(n);
	ll l=0,r=0;
	for(ll i=1;i<n;i++)
	{
		if(i<=r)
			z[i] = min(r-i+1,z[i-l]);
		else
			z[i]=0;
		while(i+z[i]<n && a[z[i]]==a[i+z[i]])
		   z[i]++;
		if(i+z[i]-1>r)
		{
			l = i;
			r = i+z[i]-1;	
		}   		
	}
	return z;
}
string s;
ll arr[600000];
vector<vector<ll> >adj(600000);
int main()
{ 
	ll t;
	t=1;
	while(t--)
	{
		ll i,n;
		cin>>n;
	    ll arr[n];
		ff(i,n)
		    cin>>arr[i];
		ll l[n+1],r[n+1];
		l[n] = 2;
		r[n] = 2;
		for(i=n-1;i>=0;i--)
		{
			ll gg = l[i]/arr[i];
			if(l[i]%arr[i]!=0)
			   gg++;
			l[i] = gg*arr[i];
			r[i] = r[i+1]/arr[i]+arr[i]-1;
			if(l[i]<=0 || r[i]<=0)
			   cout<<"-1",return 0;
		}	
		cout<<l[0]<<" "<<r[0]; 
	}	    
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:39: error: expected primary-expression before 'return'
   71 |                            cout<<"-1",return 0;
      |                                       ^~~~~~
Language: C++

#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int n;cin>>n;
  vector<ll> a(n);
  rrep(i, n)cin>>a[i];

  ll minc=2, maxc=3;
  for(auto c: a){
    if(c>maxc) { cout<<-1<<endl; return 0; }
    ll m=(minc+c-1)/c;
    minc = c*m;
    maxc = minc+c-1
//cout<<c<<' '<<m<<' '; printf("%d %d\n", minc, maxc);
  }

  printf("%d %d\n", minc, maxc);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:20: error: expected ';' before '}' token
   27 |     maxc = minc+c-1
      |                    ^
      |                    ;
   28 | //cout<<c<<' '<<m<<' '; printf("%d %d\n", minc, maxc);
   29 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){

	long long int n, mi=2, ma=3;
	vector<int> v;
  
	cin>> n;
	v.resize(n);
	for(int i=0;i<n;i++) cin>> v[i];
  	reverse(v.begin(), v.end());
  
  	if(v[0]!=2){
      	cout<< "-1" <<endl;
      	return 0;
    }
  
  	for(int i=1;i<n;i++){
        mi=mi+v[i]-1)/v[i]*v[i];
        ma=ma/v[i]*v[i]+v[i]-1;
      
      	if(ma<mi){
          	cout<< "-1" <<endl;
          	return 0;
        }
    }
  
  	cout<< mi << " " << ma <<endl;
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: expected ';' before ')' token
   20 |         mi=mi+v[i]-1)/v[i]*v[i];
      |                     ^
      |                     ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){

	long long int n, mi=2, ma=3;
	vector<int> v;
  
	cin>> n;
	v.resize(n);
	for(int i=0;i<n;i++) cin>> v[i];
  	reverse(v.begin(), v.end());
  
  	if(v[0]!=2){
      	cout<< "-1" <<endl;
      	return 0;
    }
  
  	for(int i=1;i<n;i++){
        mi=mi+v[i]-1)/v[i]*v[i];
        ma=ma, ma/v[i]*v[i]+v[i]-1;
      
      	if(ma<mi){
          	cout<< "-1" <<endl;
          	return 0;
        }
    }
  
  	cout<< mi << " " << ma <<endl;
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: expected ';' before ')' token
   20 |         mi=mi+v[i]-1)/v[i]*v[i];
      |                     ^
      |                     ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a, b;
  in(n);
  vector<ll> c(n);
  rep(i, n)
    in(c[n - i - 1]);
  if(c[0] != 2){
    out(-1);
    memi;
    return 0;
  }
  a = 2;
  b = 3;
  rep2(i, n){
    if(a > c[i] || b < c[i]){
      out(-1);
      memi;
      return 0;
    }
    else{
      a = c[i];
      b = 2 * c[i] - 1;
    }
  }
  out(a);
  hina;
  out(b);
  memi;
}

Compiler output:
a.cc:30:12: error: macro "rep2" requires 3 arguments, but only 2 given
   30 |   rep2(i, n){
      |            ^
a.cc:5:9: note: macro "rep2" defined here
    5 | #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
      |         ^~~~
a.cc: In function 'int main()':
a.cc:30:3: error: 'rep2' was not declared in this scope
   30 |   rep2(i, n){
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
int N;
int A[100000];
int func(int X){
  rep(i,0,N) X=X/A[i]*A[i];
  return X;
}
signed main(){
  cin>>N;
  rep(i,0,N) cin>>A[i];
  reverse(ALL(A));
  int X=2;
  bool flag=0;
  if(A[0]==2){
    rep(i,1,N){
      int Y=(X+A[i]-1)/A[i]*A[i];
      if(Y/A[i-1]*A[i-1]==X) X=Y;
      else{
        flag=1;
        goto XYZ;
      }
    }
    cout<<X<<" ";
    int left=0,right=INF;
    while(left+1<right){
      int mid=(left+right)/2;
      int X=func(mid);
      if(X<=2) left=mid;
      else right=mid;
    }
    int ans=left;
    if(func(right)==2) ans=right;
    cout<<ans<<endl;
  }
  else flag=1;
  XYZ:
  if(flag) cout<<-1<<endl;
  }



Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: request for member 'begin' in 'A', which is of non-class type 'long long int [100000]'
    7 | #define ALL(a) (a).begin(),(a).end()
      |                    ^~~~~
a.cc:28:11: note: in expansion of macro 'ALL'
   28 |   reverse(ALL(A));
      |           ^~~
a.cc:7:32: error: request for member 'end' in 'A', which is of non-class type 'long long int [100000]'
    7 | #define ALL(a) (a).begin(),(a).end()
      |                                ^~~
a.cc:28:11: note: in expansion of macro 'ALL'
   28 |   reverse(ALL(A));
      |           ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N; cin>>N;
  vi A(N);
  rep(i,0,N) cin>>A[i];
  reverse(ALL(A));
  bool flag=1;
  if(A[0]>2) flag=0;
  int ans=2;
  rep(i,1,N){
    int X=ans/A[i];
    X*=A[i];
    if(X<ans) X+=A[i];
    if(X/A[i-1]*A[i-1]==ans) ans=X;
    else flag=0;
  }
  if(flag){
    cout<<ans<<" ";
    ans=2;
    rep(i,1,N){
      int X=(ans+A[i-1]-ans%A[i-1]-1))/A[i];
      X*=A[i];
      if(X/A[i-1]*A[i-1]!=ans) X-=A[i];
      ans=X;
    }
    cout<<ans+A[N-1]-1<<endl;
  }
  else cout<<-1<<endl;
  }




Compiler output:
a.cc: In function 'int main()':
a.cc:38:38: error: expected ',' or ';' before ')' token
   38 |       int X=(ans+A[i-1]-ans%A[i-1]-1))/A[i];
      |                                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int a[100001];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin>>n;
	a[0]=1;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	long long int L=2,R=2;
	if(2%a[k]!=0){
		cout<<-1<<endl;
		return 0;
	}
	for(int i=n;i>=1;i--){
		R+=a[i]-1;
		L=(L%a[i-1]==0?L:((L/a[i-1]+1)*a[i-1]));
		R=R/a[i-1]*a[i-1];
		if(L>R){
			cout<<-1<<endl;
			return 0;
		}
	}
	cout<<L<<' '<<R<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'k' was not declared in this scope
   14 |         if(2%a[k]!=0){
      |                ^
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//const ll mod=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
    int n;
    cin>>n;
    V<ll> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    reverse(all(a));
    ll ma=2,mi=2;
    for(int i=0;i<n;i++){
        if(ma/a[i]==(mi-1)/a[i]){
            cout<<-1<<endl;
            return 0
            }
              mi=(mi+a[i]-1)/a[i]*a[i];
              ma=mi+a[i]-1;
    }
    cout<<mi<<" "<<ma<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: expected ';' before '}' token
   28 |             return 0
      |                     ^
      |                     ;
   29 |             }
      |             ~
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//const ll mod=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
    int n;
    cin>>n;
    V<ll> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    if(a[0]!=2){
        cout<<-1<<endl;
        return 0;
    }
    reverse(all(a));
    ll ma=2,mi=2;
    for(int i=0;i<n;i++){
        if(ma/a[i]/==(mi-1)/a[i]){
            cout<<-1<<endl;
            return 0
            }
              mi=(mi+a[i]-1)/a[i]*a[i];
              ma=mi+a[i]-1;
    }
    cout<<mi<<" "<<ma<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: expected primary-expression before '=' token
   30 |         if(ma/a[i]/==(mi-1)/a[i]){
      |                     ^
a.cc:32:21: error: expected ';' before '}' token
   32 |             return 0
      |                     ^
      |                     ;
   33 |             }
      |             ~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
ll a[100000];
int main()
{
	int n;
	ll ans=0;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	if(a[n-1]!=2)
	{
		cout<<-1<<endl;
		return 0;
	}
	ll tmp=1;
	for(int i=n-2;i>-1;i--)
	{
		ll tmp2=(a[i+1]*(tmp+1)-1)/a[i];
		if(a[i+1]*tmp>a[i]*tmp2)
		{
			cout<<-1<<endl;
			return 0;
		}
		tmp=tmp2;
	}
	l=tmp*a[0];
	r=tmp*a[0]+a[0]-1;
	cout<<l<<" "<<r<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'l' was not declared in this scope
   35 |         l=tmp*a[0];
      |         ^
a.cc:36:9: error: 'r' was not declared in this scope
   36 |         r=tmp*a[0]+a[0]-1;
      |         ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>

using namespace std;

long long a[100005]

int main() {
  int n;
  scanf("%d", &n);
  long long m = 2;
  long long M = 2;
  for (int i=0 ; i<n ; i++) scanf("%lld", a+i);
  reverse(a, a+n);
  if (a[0] != 2) {
  	printf("-1\n");
    return 0;
  }
  for (int i=0 ; i<n ; i++) {
  	M -= M%a[i];
    if (M<m) {
    	printf("-1\n");
        return 0;
    }
    M += a[i]-1;
  	m = m*a[i]/__gcd(m, a[i]);
  }
  printf("%lld %lld\n", m, M);
  return 0;
}

Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int main() {
      | ^~~
Language: C++

#include <iostream>
#include <algorihtm>
#include <cstdio>

using namespace std;

long long a[100005]

int main() {
  int n;
  scanf("%d", &n);
  long long m = 2;
  long long M = 2;
  for (int i=0 ; i<n ; i++) scanf("%lld", a+i);
  reverse(a, a+n);
  if (a[0] != 2) {
  	printf("-1\n");
    return 0;
  }
  for (int i=0 ; i<n ; i++) {
  	M -= M%a[i];
    if (M<m) {
    	printf("-1\n");
        return 0;
    }
    M += a[i]-1;
  	m = m*a[i]/__gcd(m, a[i]);
  }
  printf("%lld %lld\n", m, M);
  return 0;
}

Compiler output:
a.cc:2:10: fatal error: algorihtm: No such file or directory
    2 | #include <algorihtm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <vector>
#include <string>
using namespace std;

#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")

#define DEBUG(x) cout << ">> " << #x << ": " << x << endl;
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int MOD = 1000000007;
typedef long long ll;
typedef long double ld;

int main() { _
  int k; cin >> k;
  vector<ll> v(k, 0);
  for (int i = 0; i < k; i++) {
    cin >> v[i];
  }
  ll minn = 2, maxx = 3;
  for (int i = k-2; i >= 0; i--) {
    if (v[i] > maxx) {
      cout << -1 << endl;
      return 0;
    }
    else maxx = (ll (maxx/v[i]) + 1) * v[i] - 1;

    if (maxx < 0) maxx = LLONG_MAX;

    if (v[i] < minn) {
      minn = minn % v[i] == 0 ? minn : (ll (minn/v[i]) + 1) * v[i];
    }
    else minn = v[i];

    if (minn > maxx) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << minn << " " << maxx << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:26: error: 'LLONG_MAX' was not declared in this scope
   37 |     if (maxx < 0) maxx = LLONG_MAX;
      |                          ^~~~~~~~~
a.cc:6:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <set>
  +++ |+#include <climits>
    6 | #include <vector>
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int k;
  cin>>k;
  long long a[k];
  for (int i=0; i<k; i++) cin>>a[i];

  if (a[k-1] != 2) {
    cout<<-1<<endl;
    return 0;
  }
  long long max_n = 3, min_n = 2;;
  for (int i=k-2; i>=0; i--) {
    min_n = max(a[i], min_n);
    min_n = a[i] * ((min_n - 1) / a[i] + 1);
    long long max_n_group = max_n / a[i];
    if (max_n_group == 0) {
      cout<<-1<<endl;
      return 0;
    }
    if (max_n_group * a[i] + a[i] - 1 < max_n) {
      cout<<-1<<endl;
      return 0;
    }
    max_n = max_n_group * a[i] + a[i] - 1;
  }
  long long x = max_n, y = min_n;
  for (int i=0; i<n; i++) {
    x = x / a[i] * a[i];
    y = y / a[i] * a[i];
  }
  if (x != 2 || y != 2) {
    cout<<-1<<endl;
  } else {
    cout<<min_n<<" "<<max_n<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'n' was not declared in this scope
   30 |   for (int i=0; i<n; i++) {
      |                   ^
Language: C++

#include <bits/stdc++.h> 

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define int ll

ll main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  int K;
  cin>>K;
  vector<int>A(K);
  for(int i=0;i<K;i++)cin>>A[i];
  reverse(rng(A));
  vector<int>B=A;
  for(int i=0;i<K-1;i++){
    if(B[i]>B[i+1]){
      B[i+1]*=(B[i]+B[i+1]-1)/B[i+1];
    }
  }
  bool ok=true;
  for(int i=0;i<K-1;i++){
    if(B[i]<=B[i+1]&&B[i+1]<B[i]*2){}
    else ok=false;
  }
  int ans1=B[K-1];
  int ans2=B[K-1]+A[K-1]-1;
  if(ok)cout<<ans1<<" "<<ans2;
  else cout<<-1<<endl;
  return 0;
}


Compiler output:
a.cc:14:1: error: '::main' must return 'int'
   14 | ll main(){
      | ^~
Language: C++

/*
 _ooOoo_
 o8888888o
 88" . "88
 (| -_- |)
 O\  =  /O
 ____/`---'\____
 .'  \\|     |//  `.
 /  \\|||  :  |||//  \
 /  _||||| -:- |||||-  \
 |   | \\\  -  /// |   |
 | \_|  ''\---/''  |   |
 \  .-\__  `-`  ___/-. /
 ___`. .'  /--.--\  `. . __
 ."" '<  `.___\_<|>_/___.'  >'"".
 | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 \  \ `-.   \_ __\ /__ _/   .-` /  /
 ======`-.____`-.___\_____/___.-`____.-'======
 `=---='
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 fozubaoyou    pass System Test!
 */
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
template<class F>
auto  minimize(int imin,int imax,F &f){
    while(imax - imin > 1){
        int mid = imin + (imax - imin)/2;
        if(f(mid)) imax = mid;
        else imin = mid;
    }
    return imax;
}

/*
 [imin,imax) -> imin
 return maximum index such that v[index] <= value
 auto f(int mid) {return v[mid] <= value;}
 */
template<class F>
auto  maximize(int imin,int imax,F &f){
    while(imax - imin > 1){
        int mid = imin + (imax - imin)/2;
        if(f(mid)) imin = mid;
        else imax = mid;
    }
    return imin;
}

signed main(){
    ll K;
    cin >> K;
    vector<ll>A(K);
    for(auto & e : A) cin >> e;
    reverse(A.begin(),A.end());
    if(A.front() > 3) return puts("-1") * 0;
    ll lb = 0; ll ub = 0;
    auto lcomp = [&](ll mid){
        return (lb <= mid * crt);
    };
    auto ucomp = [&](ll mid){
        return (mid * crt <= ub);
    };
    for(ll i = 0; i < A.size(); ++i){
        crt = A[i];
        if(crt  > ub)
            return puts("-1") * 0;
        ll tlb = minimize(0, 1e15, lcomp);
        ll tub = maximize(1, 1e15, ucomp);
        lb = crt * tlb; ub = tub * crt  + crt - 1;
    }
    cout << lb << " " << ub << endl;
}



Compiler output:
a.cc: In lambda function:
a.cc:61:29: error: 'crt' was not declared in this scope; did you mean 'cbrt'?
   61 |         return (lb <= mid * crt);
      |                             ^~~
      |                             cbrt
a.cc: In lambda function:
a.cc:64:23: error: 'crt' was not declared in this scope; did you mean 'cbrt'?
   64 |         return (mid * crt <= ub);
      |                       ^~~
      |                       cbrt
a.cc: In function 'int main()':
a.cc:67:9: error: 'crt' was not declared in this scope; did you mean 'cbrt'?
   67 |         crt = A[i];
      |         ^~~
      |         cbrt
Language: C++

/*
 _ooOoo_
 o8888888o
 88" . "88
 (| -_- |)
 O\  =  /O
 ____/`---'\____
 .'  \\|     |//  `.
 /  \\|||  :  |||//  \
 /  _||||| -:- |||||-  \
 |   | \\\  -  /// |   |
 | \_|  ''\---/''  |   |
 \  .-\__  `-`  ___/-. /
 ___`. .'  /--.--\  `. . __
 ."" '<  `.___\_<|>_/___.'  >'"".
 | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 \  \ `-.   \_ __\ /__ _/   .-` /  /
 ======`-.____`-.___\_____/___.-`____.-'======
 `=---='
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 fozubaoyou    pass System Test!
 */
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
template<class F>
auto  minimize(int imin,int imax,F &f){
    while(imax - imin > 1){
        int mid = imin + (imax - imin)/2;
        if(f(mid)) imax = mid;
        else imin = mid;
    }
    return imax;
}

/*
 [imin,imax) -> imin
 return maximum index such that v[index] <= value
 auto f(int mid) {return v[mid] <= value;}
 */
template<class F>
auto  maximize(int imin,int imax,F &f){
    while(imax - imin > 1){
        int mid = imin + (imax - imin)/2;
        if(f(mid)) imin = mid;
        else imax = mid;
    }
    return imin;
}

signed main(){
    ll K;
    cin >> K;
    vector<ll>A(K);
    for(auto & e : A) cin >> e;
    reverse(A.begin(),A.end());
    if(A.front() != 2) return puts("-1") * 0;
    ll lb = A.front(); ll ub = A.front() * 2 - 1;
    ll crt = 0;
    auto lcomp = [&](ll mid){
        return (lb <= mid * crt);
    };
    auto ucomp = [&](ll mid){
        return (mid * crt  + crt - 1<= ub);
    };
    for(ll i = 1; i < A.size(); ++i){
        crt = A[i];
        if(crt  > ub)
            return puts("-1") * 0;
        ll tlb = minimize(0, 1e15, lcomp);
        ll tub = maximize(1, 1e15, ucomp);
        lb = crt * tlb; ub = mid * crt  + crt - 1;
    }
    cout << lb << " " << ub << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:73:30: error: 'mid' was not declared in this scope
   73 |         lb = crt * tlb; ub = mid * crt  + crt - 1;
      |                              ^~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int N = 1e5 + 7;
ll a[N];
int n;

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
	}
	ll ans1 = 2, ans2 = 2;
	for (int i = n; i >= 1; i--) {
		ans1 = (ans1 - 1) / a[i] + 1, ans2 = ans2 / a[i];
		if (ans1 > ans2) {
			puts("-1");
			return;
		}
		ans1 *= a[i];
		ans2 = ans2 * a[i] + a[i] - 1;
	}
	printf("%lld %lld\n", ans1, ans2);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
   19 |                         return;
      |                         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define MAX (500000)
#define pii pair<int, int>

/////////////////////////////////////////////////////////

class XY{
public:
  ll x, y;
  XY() {x = y = 0;}
  XY(ll u, ll v) {x = u; y = v;}
};

class e{
public:
  ll a, b;
  e() {a = b = -1;}
  e(ll u, ll v) {a = u; b = v;}
};

template<typename T1, typename T2>
void chmin(T1 &a, T2 b) {if(a > b) a = b;}
template<typename T1, typename T2>
void chmax(T1 &a, T2 b) {if(a < b) a = b;}

template<typename T1, typename T2>
ll mypow(T1 a, T2 n){
  if(n == 0) return 1;
  if(n == 1) return a;
  if(n % 2) return a * mypow(a, n - 1);
  ll tmp = mypow(a, n / 2);
  return tmp * tmp;
}

template<typename T>
int BS(vector<T> &V, int left, int right, T key){
  int mid = (left + right) / 2;
  if(V[mid] <= key) left = mid;
  else right = mid;
  if(right - mid == 1) return left;
  else return BS(V, left, right, key);
}

ll comb(ll n, ll r){
	ll res = 1;
  rep(i, 0, r){
    res *= n - i;
    res /= i + 1;
  }
  return res;
}

template<typename T>
T euclid(T a, T b){
  if(b == 0) return a;
  else return euclid(b, a % b);
}

ll fact[MAX], fact_inv[MAX];

ll pow_mod(ll a, ll b){
	ll res = 1;
	while(b > 0){
		if(b & 1) res = res * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return res;
}

void prepare_comb_mod(ll n){
	fact[0] = 1;
	for(ll i = 0; i < n; i++) fact[i+1] = fact[i] * (i + 1) % MOD;
	fact_inv[n] = pow_mod(fact[n], MOD - 2);
	for(ll i = n - 1; i >= 0; i--) fact_inv[i] = fact_inv[i + 1] * (i + 1) % MOD;
}

ll comb_mod(ll n, ll r){
	return (fact[n] * fact_inv[r]) % MOD * fact_inv[n - r] % MOD;
}

/////////////////////////////////////////////////////////

void Main() {
  ll K; cin >> K;
  vector<ll> A(K);
  rep(i, 0, K) cin >> A[i];
  ll mi, ma;
  mi = 2LL; ma = 3LL;
  bool ok = true;
  if(A[K - 1LL] != 2LL) ok = false;
  for(ll i = K - 2LL; i >= 0Ll; i--){
    if(!ok) break;
    if((mi - 1LL)/ A[i] >= ma / A[i]) ok = false;
    if(A[i] <= ma){
      ma = (ma / A[i] + 1LL) * A[i] - 1LL;
    }else{
      ma = 0LL;
    }
    if(A[i] < mi){
      mi = (mi / A[i] + 1LL) * A[i];
    }else{
      mi = A[i];
    }
    if(mi > ma) ok = false;
  }
  if(ok) cout << mi << " " << ma << endl;
  else cout << -1 << endl;
}

/////////////////////////////////////////////////////////

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << std::fixed << std::setprecision(15);

  Main();
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:98:28: error: unable to find numeric literal operator 'operator""Ll'
   98 |   for(ll i = K - 2LL; i >= 0Ll; i--){
      |                            ^~~
Language: C++



#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) FORR(i, n - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    REP(i, n) cin >> a[i];
    reverse(ALL(a));
    ll mn = 2;
    ll mx = 2;

    REP(i, n) {
        x = a[i];
        mn = ((mn + x - 1) / x) * x;
        mx = (mx / x) * x + x - 1;
        if (mn > mx) {
            cout << -1 << endl;
            return 0;
        }
    }

    cout << mn << " " << mx << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'x' was not declared in this scope
   28 |         x = a[i];
      |         ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  
  int k;
  cin>>k;
  long long a[k];
  REP(i,k){
    cin>>a[i];
  }
  
  long long l=2,r=2;
  long long temp;
  for(int i=k-1;i>=0;i--){
    
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:103:2: error: expected '}' at end of input
  103 | }
      |  ^
a.cc:89:11: note: to match this '{'
   89 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#include <stdlib.h>
#include <cmath>
using namespace std;

int main(){
    int K;
    vector<long long> A;
    cin>>K;
    for(int i=0;i<K;i++){
        long long x;
        cin>>x;
        A.push_back(x);
    }

    long long m=2;
    long long M=3;
    bool ans=true;
    if(A.at(K-1)!=2) ans=false;
    else if(K>=2){
        
        for(int i=K-2;i>=0;i--){
            //cout<<m<<' '<<M<<endl;
            long long x=A.at(i);
            if(x>=2*Max) {ans=false;break;}
            else{
                long long l=(m-1)/x, b=M/x;
                l++; b++;
                m=l*x; M=b*x-1;
                
            }

        }
    }

    if(ans) cout<<m<<' '<<M<<endl;
    else cout<<-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'Max' was not declared in this scope
   25 |             if(x>=2*Max) {ans=false;break;}
      |                     ^~~
Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using static Input;
public class Hello
{
    public static void Main()
    {
        int K = NextInt();
        long[] A = LineLong();
        long min = 2, max = 2;
        for (int i = K - 1; i >= 0; i--)
        {
            min = (long)Math.Ceiling(min / (A[i] + .0)) * A[i];
            max = (max / A[i]) * A[i] + A[i] - 1;
        }
        Console.WriteLine((min > max ? "-1" : min + " " + max));
    }
}

public class Input
{
    private static Queue<string> queue = new Queue<string>();
    private static void Confirm() { if (queue.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) queue.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(queue.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(queue.Dequeue()); }
    public static string NextString() { Confirm(); return queue.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(queue.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'static'
    4 | using static Input;
      |       ^~~~~~
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Hello
      | ^~~~~~
a.cc:21:1: error: expected unqualified-id before 'public'
   21 | public class Input
      | ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> ii;

int K;
vll A;

int main(){
  cin>>K;
  for (int i=0;i<N;++i){
    int a;cin>>a;A.push_back(a);
  }

  ll ans_max=2, ans_min=2;

  for (int i=K-1;i>=0;--i){
    ll x=ans_min;
    ll y=ans_max;
    int q=ans_min/A[i], r=ans_min%A[i];
    if(r!=0) ans_min=(q+1)*A[i];
    q=ans_max/A[i], r=ans_max%A[i];
    ans_max=q*A[i]+A[i]-1;
    if(ans_min>y|| ans_max<x) cout << -1 << endl;return 0; 
  }

  cout << ans_min << ' ' << ans_max << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'N' was not declared in this scope
   13 |   for (int i=0;i<N;++i){
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> ii;
 
int K;
vll A;
 
int main(){
  cin>>K;
  for (int i=0;i<K;++i){
    int a;cin>>a;A.push_back(a);
  }
 
  ll ans=2;
  if(!A[K-1]==1&&!A[K-1]==2){cout << -1 << endl;return 0;}
  ll ans_min=ans;
  ll ans_max=ans+A[K-1]-1;
  if(K==1){cout << ans_min << ' ' << ans_max << endl;return 0;}
  for (int i=K-2;i>=0;--i){
    ll x=ans_min, y=ans_max;
    int q=ans_min/A[i], r=ans_min%A[i];
    if(r!=0) {ans_min=(q+1)*A[i]};if(ans_min>y||ans_min<x) {cout << -1 << endl;return 0;}
    q=ans_max/A[i], r=ans_max%A[i];
    ans_max=q*A[i]+A[i]-1;
    if(ans_max>y||ans_max<x) {cout << -1 << endl;return 0;} 
  }
 
  cout << ans_min << ' ' << ans_max << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: expected ';' before '}' token
   25 |     if(r!=0) {ans_min=(q+1)*A[i]};if(ans_min>y||ans_min<x) {cout << -1 << endl;return 0;}
      |                                 ^
      |                                 ;