Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#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 SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
	int n;
	cin >> n;
	ll t=0, a=0;
	cin >> t >> a;
	ll tmp_t, tmp_a, rate_t, rate_a, rate;
	REP(i, n-1){
		cin >> tmp_t >> tmp_a;
			rate_t = t%tmp_t==0 ? (int)(t/tmp_t) : (int)(t/tmp_t) + 1;
			rate_a = a%tmp_a==0 ? (int)(a/tmp_a) : (int)(a/tmp_a) + 1;
			rate = max(rate_t, rate_a);
			t = rate * tmp_t;
			a = rate * tmp_a;
		} else {
			t = tmp_t;
			a = tmp_a;
		}
	}
	cout << t+a << '\n';
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'll' was not declared in this scope
   23 |         ll t=0, a=0;
      |         ^~
a.cc:24:16: error: 't' was not declared in this scope
   24 |         cin >> t >> a;
      |                ^
a.cc:24:21: error: 'a' was not declared in this scope
   24 |         cin >> t >> a;
      |                     ^
a.cc:25:11: error: expected ';' before 'tmp_t'
   25 |         ll tmp_t, tmp_a, rate_t, rate_a, rate;
      |           ^~~~~~
      |           ;
a.cc:27:24: error: 'tmp_t' was not declared in this scope; did you mean 'time_t'?
   27 |                 cin >> tmp_t >> tmp_a;
      |                        ^~~~~
      |                        time_t
a.cc:27:33: error: 'tmp_a' was not declared in this scope; did you mean 'tmpnam'?
   27 |                 cin >> tmp_t >> tmp_a;
      |                                 ^~~~~
      |                                 tmpnam
a.cc:28:25: error: 'rate_t' was not declared in this scope
   28 |                         rate_t = t%tmp_t==0 ? (int)(t/tmp_t) : (int)(t/tmp_t) + 1;
      |                         ^~~~~~
a.cc:29:25: error: 'rate_a' was not declared in this scope
   29 |                         rate_a = a%tmp_a==0 ? (int)(a/tmp_a) : (int)(a/tmp_a) + 1;
      |                         ^~~~~~
a.cc:30:25: error: 'rate' was not declared in this scope
   30 |                         rate = max(rate_t, rate_a);
      |                         ^~~~
a.cc:33:19: error: 'else' without a previous 'if'
   33 |                 } else {
      |                   ^~~~
a.cc:34:29: error: 'tmp_t' was not declared in this scope; did you mean 'time_t'?
   34 |                         t = tmp_t;
      |                             ^~~~~
      |                             time_t
a.cc:35:29: error: 'tmp_a' was not declared in this scope; did you mean 'tmpnam'?
   35 |                         a = tmp_a;
      |                             ^~~~~
      |                             tmpnam
a.cc: At global scope:
a.cc:38:9: error: 'cout' does not name a type
   38 |         cout << t+a << '\n';
      |         ^~~~
a.cc:40:9: error: expected unqualified-id before 'return'
   40 |         return 0;
      |         ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^