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

#include<stdio.h>
#includ<math.h>

int main(void){

	int N,K;

	scanf("%d%d",&N,&K);

	printf("%d",K*pow(K-1,N-1))

	return 0;
}



Compiler output:
main.c:2:2: error: invalid preprocessing directive #includ; did you mean #include?
    2 | #includ<math.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:10:23: error: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
   10 |         printf("%d",K*pow(K-1,N-1))
      |                       ^~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'pow'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | #includ<math.h>
main.c:10:23: warning: incompatible implicit declaration of built-in function 'pow' [-Wbuiltin-declaration-mismatch]
   10 |         printf("%d",K*pow(K-1,N-1))
      |                       ^~~
main.c:10:23: note: include '<math.h>' or provide a declaration of 'pow'
main.c:10:36: error: expected ';' before 'return'
   10 |         printf("%d",K*pow(K-1,N-1))
      |                                    ^
      |                                    ;
   11 | 
   12 |         return 0;
      |         ~~~~~~
Language: C

#include <stdio.h>

int main(){
    int n;
    unsigned long long int k;
    scanf("%d %llud", &n, &k);
    unsigned long long int answer = k;
    for(i = 1; i < n; i++){
        answer = answer * (k - 1);
    }
    printf("%llud", answer);
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: 'i' undeclared (first use in this function)
    8 |     for(i = 1; i < n; i++){
      |         ^
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;

public class Main{

int ruijo(int n, int r){
  if(r == 0) return 1;
  else return n*ruijo(n,r-1);
}

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), K = sc.nextInt();
    System.out.println(K*ruijo(N-1,K-1));
  }
}

Compiler output:
Main.java:13: error: non-static method ruijo(int,int) cannot be referenced from a static context
    System.out.println(K*ruijo(N-1,K-1));
                         ^
1 error
Language: C

#include <stdio.h>

int main(void) {
	int n,k,i,j,pos;
	printf("please give num of balls and num of paints");
	scanf("%d %d",&n,%k);
	i=0;
	j=0;
	for(i=0;i<n;i++)
	{
		for(j=0;j<k;j++)
		{
			if(i!=j)
			{
				pos++;
			}
		}
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:26: error: expected expression before '%' token
    6 |         scanf("%d %d",&n,%k);
      |                          ^
Language: Java


public class Main {

	public static void main(String[] args) {
		int N,K;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		K = sc.nextInt();
		sc.close();
		int pattern = K;
		for(int i=0;i<N-1;i++){
			pattern *= (K-1);
		}
		System.out.println(pattern);
	}

}


Compiler output:
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

int main () {
  int N;
  cin >> N;
  int T[N];
  int N[N];
  for (int i = 0; i < N; i ++){
    cin >> T[i] >> N[i];
  }
  for (int i = 1; i < N; i ++){
    while (T[i - 1] > T[i] || N[i - 1] > N[i]){
      int countT = T[i - 1] / T[i];
      int countN = N[i - 1] / N[i];
      int big = max(countT, countN);
      T[i] *= (big + 1);
      N[i] *= (big + 1);
    }
  }
  cout << T[N - 1] + N[N - 1] << '\n';
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: conflicting declaration 'int N [N]'
    9 |   int N[N];
      |       ^
a.cc:6:7: note: previous declaration as 'int N'
    6 |   int N;
      |       ^
a.cc:11:21: error: invalid types 'int[int]' for array subscript
   11 |     cin >> T[i] >> N[i];
      |                     ^
a.cc:14:32: error: invalid types 'int[int]' for array subscript
   14 |     while (T[i - 1] > T[i] || N[i - 1] > N[i]){
      |                                ^
a.cc:14:43: error: invalid types 'int[int]' for array subscript
   14 |     while (T[i - 1] > T[i] || N[i - 1] > N[i]){
      |                                           ^
a.cc:16:21: error: invalid types 'int[int]' for array subscript
   16 |       int countN = N[i - 1] / N[i];
      |                     ^
a.cc:16:32: error: invalid types 'int[int]' for array subscript
   16 |       int countN = N[i - 1] / N[i];
      |                                ^
a.cc:19:8: error: invalid types 'int[int]' for array subscript
   19 |       N[i] *= (big + 1);
      |        ^
a.cc:22:23: error: invalid types 'int[int]' for array subscript
   22 |   cout << T[N - 1] + N[N - 1] << '\n';
      |                       ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

int main () {
  int N;
  cin >> N;
  int T[N], N[N];
  for (int i = 0; i < N; i ++){
    cin >> T[i] >> N[i];
  }
  for (int i = 1; i < N; i ++){
    while (arrT[i - 1] > arrT[i] || arrN[i - 1] > arrN[i]){
      int countT = arrT[i - 1] / arrT[i];
      int countN = arrN[i - 1] / arrN[i];
      int big = max(countT, countN);
      arrT[i] *= (big + 1);
      arrN[i] *= (big + 1);
    }
  }
  cout << arrT[N - 1] + arrN[N - 1] << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: conflicting declaration 'int N [N]'
    8 |   int T[N], N[N];
      |             ^
a.cc:6:7: note: previous declaration as 'int N'
    6 |   int N;
      |       ^
a.cc:10:21: error: invalid types 'int[int]' for array subscript
   10 |     cin >> T[i] >> N[i];
      |                     ^
a.cc:13:12: error: 'arrT' was not declared in this scope
   13 |     while (arrT[i - 1] > arrT[i] || arrN[i - 1] > arrN[i]){
      |            ^~~~
a.cc:13:37: error: 'arrN' was not declared in this scope
   13 |     while (arrT[i - 1] > arrT[i] || arrN[i - 1] > arrN[i]){
      |                                     ^~~~
a.cc:21:11: error: 'arrT' was not declared in this scope
   21 |   cout << arrT[N - 1] + arrN[N - 1] << '\n';
      |           ^~~~
a.cc:21:25: error: 'arrN' was not declared in this scope
   21 |   cout << arrT[N - 1] + arrN[N - 1] << '\n';
      |                         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  
  vector<int> T(n), A(n);
  for (int i = 0; i < n; i++) {
    cin >> T.at(i) >> A.at(i);
  }
  
  int64_t t = 1;
  int64_t a = 1;
  int_64 s, x, y;
  for (int i = 0; i < n; i++) {
    x = (t+(T.at(i)-1)) / T.at(i);
    y = (a+(A.at(i)-1)) / A.at(i);
    s = max(x, y);
    t = s * T.at(i);
    a = s * A.at(i);
  }
  
  cout << t + a << endl;
}
             

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'int_64' was not declared in this scope; did you mean 'rintf64'?
   15 |   int_64 s, x, y;
      |   ^~~~~~
      |   rintf64
a.cc:17:5: error: 'x' was not declared in this scope
   17 |     x = (t+(T.at(i)-1)) / T.at(i);
      |     ^
a.cc:18:5: error: 'y' was not declared in this scope
   18 |     y = (a+(A.at(i)-1)) / A.at(i);
      |     ^
a.cc:19:5: error: 's' was not declared in this scope
   19 |     s = max(x, y);
      |     ^
Language: C++

#include<cmath>
using namespace std;

int main(){
    int N;
    cin >> N;
    int T[N];
    int A[N];
    for(int i=0; i<N; i++){
        cin >> T[i] >> A[i];
    }

    long long currentT = T[0], currentA = A[0];
    for(int i=1; i<N; i++){
        long long nextT=T[i], nextA=A[i];
        if(nextT < currentT || nextA < currentA){
            long long scale = max(currentT/nextT, currentA/nextA);
            nextT = T[i]*scale;
            nextA = A[i]*scale;
            if(nextT < currentT || nextA < currentA){
                scale++;
                nextT = T[i]*scale;
                nextA = A[i]*scale;
            }
        }
        currentT = nextT;
        currentA = nextA;
    }
    cout << (currentT + currentA) << '\n';

}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> N;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cmath>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:29:5: error: 'cout' was not declared in this scope
   29 |     cout << (currentT + currentA) << '\n';
      |     ^~~~
a.cc:29:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++





#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007


 int main(){

 long long n;
 cin>>n;

 pair<long long,long long>ta;

 for(long long i=0;i<n;i++){
    long long T,A;
    cin>>T>>A;

    if(i == 0){
        ta = make_pair(T,A);
        continue;}
    long long n1 = minn(ta.first,T);
    long long n2 = minn(ta.second,A);
    int n = max(n1,n2);

    ta.first = n*t;
    ta.second = n*A;
 }

 cout<<ta.first + ta.second<<endl;

  return 0;
 }

/*
 long long f(long long x){

     long long  cnt=0;
     while(x){
      cnt += 1;
      x = x/10;
     }

 return cnt;
 }

 int main(){

 long long n,ans=0;
 cin>>n;


 for(long long i=1;i<= sqrt(n);i++){

   if(n%i == 0){
     if(ans == 0)
        ans = max(f(i),f(n/i));
     else
        ans = min(max(f(i),f(n/i)),ans);
   }
 }

 cout<<ans<<endl;

  return 0;
 }


 */


Compiler output:
a.cc: In function 'int main()':
a.cc:37:20: error: 'minn' was not declared in this scope
   37 |     long long n1 = minn(ta.first,T);
      |                    ^~~~
a.cc:41:18: error: 't' was not declared in this scope
   41 |     ta.first = n*t;
      |                  ^
Language: C++

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

int main() {
  int N;
  cin >> N;

  
   vector<int> T(N);
  vector<int> A(N); 

  for (int i = 0; i < N; i++) {
    cin >> T[i] >> A[i];
  }
  
  int S = T[0] + A[0];
  for(int i = 1; i < N; i++){
      if(T[i] < T[i-1] || A[i] < A[i-1]){
          int p = max((double)T[i-1]/(double)T[i],(double)A[i-1]/(double)A[i]) + 0.9999999999;
          T[i] = T[i]*p;
          A[i] = A[i]*p;
      }
  S = T[i] + A[i];
  }

  cout << S << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: expected '}' at end of input
   26 |   cout << S << endl;
      |                     ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()	{
  int n;
  cin >> n;
  int t[n], a[n];
  for (int i = 0; i < n; i++)	{
	cin >> t[i];
	cin >> a[i];
  }
  long long A = 1, B = 1;
  long long total = 0;
  for (int i = 0; i < n; i++)	{
	long long x = t[i], y = a[i];
  	long long n = max((A - 1) / x + 1), (B - 1) / y + 1);
    A = n * x;
	B = n * y;
  }
  total = A + B;
  cout << total << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: no matching function for call to 'max(long long int)'
   19 |         long long n = max((A - 1) / x + 1), (B - 1) / y + 1);
      |                       ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()	{
  int n;
  cin >> n;
  int t[n], a[n];
  for (int i = 0; i < n; i++)	{
	cin >> t[i];
    cin >> a[i];
  }
  int A = 1, B = 1;
  int total = 0;
  for (int i = 0; i < votes.size(); i++)	{
	int x = t[i], y = a[i];
  	int n = max(ceil(A / x), ceil(B / y));
    A = n * x;
	B = n * y;
  }
  total = A + B;
  cout << total << endl;
  return 0;
}

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

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()	{
  int n;
  cin >> n;
  int t[n], a[n];
  for (int i = 0; i < n; i++)	{
	cin >> t[i];
    cin >> a[i];
  }
  int A = 1, B = 1;
  int total = 0;
  for (int i = 0; i < votes.size(); i++)	{
	int x = t[i], y = a[i];
  	int n = max(ceil(A / x), ceil(B / y));
    A = n * x;
	B = n * y;
  }
  total = a + b;
  cout << total << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: 'votes' was not declared in this scope
   17 |   for (int i = 0; i < votes.size(); i++)        {
      |                       ^~~~~
a.cc:23:15: error: 'b' was not declared in this scope
   23 |   total = a + b;
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()	{
  int n;
  cin >> n;
  int t, u;
  vector<pair<int, int>> votes;
  for (int i = 0; i < n; i++)	{
    cin >> t;
    cin >> u
    votes.push_back(make_pair(t, u));
  }
  int a = 1, b = 1;
  int total = 0;
  for (int i = 0; i < votes.size() - 1; i++)	{
    int x = votes[i + 1].first, y = votes[i + 1].second;
  	int n = max(ceil(a / x), ceil(a / y));
    a = n * x;
	b = n * y;
  }
  total = a + b;
  cout << total << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before 'votes'
   14 |     cin >> u
      |             ^
      |             ;
   15 |     votes.push_back(make_pair(t, u));
      |     ~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()	{
  int n;
  cin >> n;
  int t;
  vector<pair<int, int>> votes;
  for (int i = 0; i < n; i++)	{
    cin >> t;
    votes.push_back(t);
  }
  int a = 1, b = 1;
  int total = 0;
  for (int i = 0; i < votes.size() - 1; i++)	{
    int x = votes[i + 1].first, y = votes[i + 1].second;
  	int n = max(ceil(a / x), ceil(a / y));
    a = n * x;
	b = n * y;
  }
  total = a + b;
  cout << total << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(int&)'
   14 |     votes.push_back(t);
      |     ~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>

using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;
typedef pair<ll, ll> PLL;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
int n;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> n;

  ll x = 1, y = 1;

  REP(i, n) {
    int t, a;
    cin >> t >> a;

    ll left = 0, right = max(a, b);
    while(right - left > 1) {
      ll mid = (right + left) / 2;
      if(mid * t >= x && mid * a >= y) right = mid;
      else left = mid;
    }

    x = right * t; y = right * a;
  }

  cout << (x + y) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:33: error: 'b' was not declared in this scope
   50 |     ll left = 0, right = max(a, b);
      |                                 ^
Language: C++

#include <iostream>

using namespace std;

typedef unsigned int u_long;

void fix(u_long & LC, u_long & LA, u_long RT, u_long RA);

int main () {

    u_long N, T, A, CT, CA;
    cin >> N;

    cin >> CT >> CA;

    while (--N > 0) {
        cin >> T >> A;
        fix(CT, CA, T, A);
    }

    cout << CT + CA << endl;

    return 0;
}

void fix(u_long & LT, u_long & LA, u_long RT, u_long RA) {
    u_long mt = LT/RT, ma = LA/RA;
    if (LT % RT != 0) mt++;
    if (LA % RA != 0) ma++;
    u_long m = mt > ma ? mt : ma;
    
    LT = m * RT;
    LA = m * RA;
}


Compiler output:
a.cc:5:22: error: conflicting declaration 'typedef unsigned int u_long'
    5 | typedef unsigned int u_long;
      |                      ^~~~~~
In file included from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/sys/types.h:36:18: note: previous declaration as 'typedef __u_long u_long'
   36 | typedef __u_long u_long;
      |                  ^~~~~~
Language: C++

#include <iostream>

using namespace std;

typedef unsigned int ulong;

void fix(ulong & LC, ulong & LA, ulong RT, ulong RA);

int main () {

    ulong N, T, A, CT, CA;
    cin >> N;

    cin >> CT >> CA;

    while (--N > 0) {
        cin >> T >> A;
        fix(CT, CA, T, A);
    }

    cout << CT + CA << endl;

    return 0;
}

void fix(ulong & LT, ulong & LA, ulong RT, ulong RA) {
    ulong mt = LT/RT, ma = LA/RA;
    if (LT % RT != 0) mt++;
    if (LA % RA != 0) ma++;
    ulong m = mt > ma ? mt : ma;
    
    LT = m * RT;
    LA = m * RA;
}


Compiler output:
a.cc:5:22: error: conflicting declaration 'typedef unsigned int ulong'
    5 | typedef unsigned int ulong;
      |                      ^~~~~
In file included from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/sys/types.h:148:27: note: previous declaration as 'typedef long unsigned int ulong'
  148 | typedef unsigned long int ulong;
      |                           ^~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class atcoder_46_C {
	static class FastReader{
		BufferedReader br;
		StringTokenizer st;
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		public String next() {
			while(st==null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
					
				}
				catch(IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
	public static void main(String[] args) {
		FastReader ob = new FastReader();
		int n = ob.nextInt();
		long arr[][] = new long[n][n];
		for(int i=0;i<n;i++) {
			arr[i][0] = ob.nextLong();
			arr[i][1]=ob.nextLong();
		}
		
		for (int i = 1; i < arr.length; i++) {
			long k1=1,k2=1;
			if(arr[i-1][0]>arr[i][0]) {
				k1=(arr[i-1][0]/arr[i][0]);
				if(arr[i-1][0]%arr[i][0]!=0) {
					k1++;
				}
			}
			if(arr[i-1][1]>arr[i][1]) {
				k2=(arr[i-1][1]/arr[i][1]);
				if(arr[i-1][1]%arr[i][1]!=0) {
					k2++;
				}
			}
			k1=Math.max(k1, k2);
			arr[i][0]*=k1;
			arr[i][1]*=k1;
			//System.out.println(arr[i][0]+" "+arr[i][1]);
		}
		System.out.println(arr[n-1][0]+arr[n-1][1]);
	}
}


Compiler output:
Main.java:6: error: class atcoder_46_C is public, should be declared in a file named atcoder_46_C.java
public class atcoder_46_C {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class atcoder_46_C {
	static class FastReader{
		BufferedReader br;
		StringTokenizer st;
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		public String next() {
			while(st==null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
					
				}
				catch(IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
	public static void main(String[] args) {
		FastReader ob = new FastReader();
		int n = ob.nextInt();
		int arr[][] = new int[n][n];
		for(int i=0;i<n;i++) {
			arr[i][0] = ob.nextInt();
			arr[i][1]=ob.nextInt();
		}
		
		for (int i = 1; i < arr.length; i++) {
			int k1=1,k2=1;
			if(arr[i-1][0]>arr[i][0]) {
				k1=(arr[i-1][0]/arr[i][0]);
				if(arr[i-1][0]%arr[i][0]!=0) {
					k1++;
				}
			}
			if(arr[i-1][1]>arr[i][1]) {
				k2=(arr[i-1][1]/arr[i][1]);
				if(arr[i-1][1]%arr[i][1]!=0) {
					k2++;
				}
			}
			k1=Math.max(k1, k2);
			arr[i][0]*=k1;
			arr[i][1]*=k1;
			System.out.println(arr[i][0]+" "+arr[i][1]);
			
		}
		System.out.println(arr[n-1][0]+arr[n-1][1]);
	}

}


Compiler output:
Main.java:6: error: class atcoder_46_C is public, should be declared in a file named atcoder_46_C.java
public class atcoder_46_C {
       ^
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int[][] ta = new int[n][2];
    int t = 1;
    int a = 1;

    for (int[] x : ta) {
      int power = max(x[0]/t, x[1]/a);
      t = x[0]*power;
      a = x[1]*power;
    }

    System.out.println(t+a);
  }
}


Compiler output:
Main.java:13: error: cannot find symbol
      int power = max(x[0]/t, x[1]/a);
                  ^
  symbol:   method max(int,int)
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int[] ta = new int[n][2];
    int t = 0;
    int a = 0;

    for (int[] x : ta) {
      while(x[0] >= t && x[1] >= a){
        x[0] *= 2;
        x[1] *= 2;
      }
      t = x[0];
      a = x[1];
    }

    System.out.println(t+a);
  }
}

Compiler output:
Main.java:8: error: incompatible types: int[][] cannot be converted to int[]
    int[] ta = new int[n][2];
               ^
Main.java:12: error: incompatible types: int cannot be converted to int[]
    for (int[] x : ta) {
                   ^
2 errors
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
using namespace std;
typedef long long llong;
int main(){
    int n;
    cin >> n;
    
    llong ax, ay;
    int x, y;

    cin >> x >> y;
    ax = x; 
    ay = y;

    for (int i = 0; i < n - 1; i++){
        scanf("%d %d", &x, &y);

        if (ax < x) ax = x;
        else if (ax % x != 0) ax += x - (ax % x);

        if (ax * y / x < ay) ax += (ay - ax / x * y) / y * x;

        while (ax * y / x < ay) ax += x;

        ay = ax * y / x;
    }

    cout << ax + ay << endl;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: expected '}' at end of input
   34 |     return 0;
      |              ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
using namespace std;
typedef long long llong;
int main(){
    int n;
    cin >> n;
    
    llong ax, ay;
    int x, y;

    cin >> x >> y;
    ax = x; 
    ay = y;

    for (int i = 0; i < n - 1; i++){
        scanf("%d %d" &x, &y);

        while (!(ax % x == 0)){
            ax++;
        }
        ay - ax / x * y;

        while(ax * y / x < ay){
            ax += x;
        }

        ay = ax * y / x;
    }

    cout << ax + ay << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: invalid operands of types 'const char [6]' and 'int' to binary 'operator&'
   21 |         scanf("%d %d" &x, &y);
      |               ~~~~~~~ ^~
      |               |        |
      |               |        int
      |               const char [6]
Language: Java

import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		long T[] = new int[N];
		long A[] = new int[N];
		long xt = 1;
		long xa = 1;
		
		for(int i = 0; i < N; i++) {
			T[i] = Integer.parseInt(sc.next());
			A[i] = Integer.parseInt(sc.next());
		}
		
		for(int i = 0; i < N; i++) {
			long kake = (long) Math.max(Math.ceil((xt - 1 + T[i])/T[i]), Math.ceil((xa - 1 + A[i])/A[i]));
			xt = T[i] * kake;
			xa = A[i] * kake;
		}
		System.out.println(xt + xa);
	}
}


Compiler output:
Main.java:6: error: incompatible types: int[] cannot be converted to long[]
		long T[] = new int[N];
		           ^
Main.java:7: error: incompatible types: int[] cannot be converted to long[]
		long A[] = new int[N];
		           ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int n;
	cin >> n;
	vector<P> v(n);
	ll T,A;
	for(int i = 0; i < n; i++) {
		cin >> T >> A;
		v[i] = mp(T,A); 
	}
	// ll a = 1,b = 1;
	// for(int i = 0; i < n; i++) {
	// 	ll x = max((a + v[i].fs + a - 1)/v[i].fs,(b + v[i].sc - 1)/v[i].sc);
	// 	a = x * v[i].fs;
	// 	b = x * v[i].sc;
	// }
	// cout << a + b << endl;
	for(int i = 1; i < n; i++) {
		ll lb = 0;
		ll ub = 1<<18;
		while(ub - lb > 1){
			ll mid = (lb + ub)/2;
			if ((a[i - 1].fs <= a[i].fs * mid) && (a[i - 1].sc <= a[i].sc * mid)){
				ub = mid;
			}
			else{
				lb = mid;
			}

			// cout << a[i].fs << ' ' << a[i].sc << endl;
			// cout << mid <<endl;
		} 
		a[i].fs*= ub;
		a[i].sc *= ub;
		// cout << a[i].fs << ' ' << a[i].sc << endl;
	}
	cout << a[n - 1].fs + a[n - 1].sc << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:30: error: 'a' was not declared in this scope
   37 |                         if ((a[i - 1].fs <= a[i].fs * mid) && (a[i - 1].sc <= a[i].sc * mid)){
      |                              ^
a.cc:47:17: error: 'a' was not declared in this scope
   47 |                 a[i].fs*= ub;
      |                 ^
a.cc:51:17: error: 'a' was not declared in this scope
   51 |         cout << a[n - 1].fs + a[n - 1].sc << endl;
      |                 ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  long double t[n], a[n];
  for ( int i = 0; i < n; i++){
    cin >> t[i] >> a[i];
    if ( i == 0)continue;
    if ( t[i] >= t[i-1] && a[i] >= a[i-1])continue;

    long double mul = max(ceil(t[i-1]/t[i]), ceil(a[i-1]/a[i]));
    t[i] = t[i] * mul;
    a[i] = a[i] * mul;
  }

  cout << long long(t[n-1] + a[n-1]) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: expected primary-expression before 'long'
   18 |   cout << long long(t[n-1] + a[n-1]) << endl;
      |           ^~~~
Language: C++

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

int main(){
  int i,j,cnt;
  int n;
  ll t=2,a=2;
  cin>>n;
  ll T[n],A[n];
  for(i=0;i<n;i++)cin>>T[i]>>A[i];
  for(i=0;i<n;i++){
    j=max((t+T[i]-1)/T[i],(a+A[i]-1)/A[i]);
    while(t>T[i]*j || a>A[i]*j)j++;
    t=j*T[i];
    a=j*A[i];
    }
  }
  cout<<t+a;
}

Compiler output:
a.cc:19:3: error: 'cout' does not name a type
   19 |   cout<<t+a;
      |   ^~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    ll t, a, A = 1, T = 1;
    REP(i, N) {
        cint >> t >> a;
        ll n = max((T + t - 1) / t, (A + a - 1) / a);
        T = n * t;
        A = n * a;
    }
    cout << T + A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cint' was not declared in this scope; did you mean 'uint'?
   10 |         cint >> t >> a;
      |         ^~~~
      |         uint
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    ll t, a, A = 1, T = 1;
    REP(i, N) {
        cint >> t >> a;
        ll n = max((T + t - 1) / t, (A + a - 1) / a);
        T = n * t[i];
        A = n * a[i];
    }
    cout << T + A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cint' was not declared in this scope; did you mean 'uint'?
   10 |         cint >> t >> a;
      |         ^~~~
      |         uint
a.cc:12:18: error: invalid types 'll {aka long long int}[int]' for array subscript
   12 |         T = n * t[i];
      |                  ^
a.cc:13:18: error: invalid types 'll {aka long long int}[int]' for array subscript
   13 |         A = n * a[i];
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<int> t(N), a(N);
    REP(i, N) { cin >> t[i] >> a[i]; }
    int A, T = 1;
    for(int i = 0; i < N; i++) {
        ll x = (T + t[i] - 1) / t[i];
        ll y = (A + a[i] - 1) / a[i];
        ll n = max(x, y);
        T = n * t[i];
        A = n * a[i];
    }
    cout << T + A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     REP(i, N) { cin >> t[i] >> a[i]; }
      |         ^
a.cc:7:5: error: 'REP' was not declared in this scope
    7 |     REP(i, N) { cin >> t[i] >> a[i]; }
      |     ^~~
a.cc:10:9: error: 'll' was not declared in this scope
   10 |         ll x = (T + t[i] - 1) / t[i];
      |         ^~
a.cc:11:11: error: expected ';' before 'y'
   11 |         ll y = (A + a[i] - 1) / a[i];
      |           ^~
      |           ;
a.cc:12:11: error: expected ';' before 'n'
   12 |         ll n = max(x, y);
      |           ^~
      |           ;
a.cc:13:13: error: 'n' was not declared in this scope
   13 |         T = n * t[i];
      |             ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int lcm(int a, int t){
  int A = a, T = t;
  int gcd = 0;
  //euclid;
  if(a < t){
    int tmp = t;
    t = a;
    a = tmp;
  }
  int d = 0;
  int r = 0;
  while(r != 0){
    d = t / a;
    r = t % a;
    t = r;
    a = d;
  }
  gcd = a;
  return (A * T) / gcd;
}

int main(){
  int N;
  cin >> N;
  vector<int> A(N), T(N), L(N);
  for(int i = 0; i < N; i++) cin >> A[i] >> T[i];
  for(int i = 0; i < N; i++) L[i] = lcm(A[i], T[i]);
  //A'[i] T'[i] = 最小公倍数のlcm[i]の倍数で、A[i-1], T[i-1] 以上で最小なA'[i] T'[i]
  for(int i = 1; i < N; i++){
    int preA = A[i-1], preT = T[i-1];
    for(int i = 1; i < 100; i++){
      int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      if(nowA < preA || nowT < preT) continue;
      else{
        A[i] = nowA, T[i] = nowT;
        break;
      }
    }
  }
  int ans = A[N-1] + T[N-1];
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   37 |       int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      |                       ^
a.cc:37:25: error: invalid operands of types 'int(int, int)' and 'int' to binary 'operator*'
   37 |       int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      |                  ~~~~~~ ^ ~
      |                       |   |
      |                       |   int
      |                       int(int, int)
a.cc:38:25: error: 'nowT' was not declared in this scope; did you mean 'nowA'?
   38 |       if(nowA < preA || nowT < preT) continue;
      |                         ^~~~
      |                         nowA
Language: C++

#include <isotream>
#include <vector>

using namespace std;

int lcm(int a, t){
  int A = a, T = t;
  int gcd = 0;
  //euclid;
  if(a < t){
    int tmp = t;
    t = a;
    a = tmp;
  }
  int d = 0;
  int r = 0;
  while(r != 0){
    d = t / a;
    r = t % a;
    t = r;
    a = d;
  }
  gcd = a;
  return (A * T) / gcd;
}

int main(){
  int N;
  cin >> N
  vector<int> A(N), T(N), L(N);
  for(int i = 0; i < N; i++) cin >> A[i] >> T[i];
  for(int i = 0; i < N; i++) L[i] = lcm(A[i], T[i]);
  //A'[i] T'[i] = 最小公倍数のlcm[i]の倍数で、A[i-1], T[i-1] 以上で最小なA'[i] T'[i]
  for(int i = 1; i < N; i++){
    int preA = A[i-1], preT = T[i-1];
    for(int i = 1; i < 100; i++){
      int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      if(nowA < preA || nowT < preT) continue;
      else{
        A[i] = nowA, T[i] = nowT;
        break;
      }
    }
  }
  int ans = A[N-1] + T[N-1];
  cout << ans;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int kuriage(long long int x, long long int y) {
    return (x + (y - 1)) / y;
}

int main() {
    int n; 
    cin >> n;
    long long int a, b;
    cin >> a >> b;
    rep (i, n - 1) {
        long long int c, d;
        cin >> c >> d;
        if (a <= c && b <= d) {
            a = c; b = d;
        }
        else {
            long long int kake = max (kuriage(a,c), kuriage(b,d))
            a = c * kake; b = d * kake;
        }
    }
    cout << a + b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: expected ',' or ';' before 'a'
   22 |             a = c * kake; b = d * kake;
      |             ^
Language: C++

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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
const int M = 1e9 + 7;
const int INF = 1e9;
const int MAX_V = 1000 + 5;
const int MAX_N = 1e5 + 5;

int main() {
    ll n;
    cin >> n;
    vector<P> p;
    rep(i, n) {
        ll a, b;
        cin >> a >> b;
        p.push_back(P(a, b));
    }
    ll ans;
    x, y;
    x = p[0].first;
    y = p[0].second;
    repeat(i, 1, n) {
        ll f = p[i].first;
        ll s = p[i].second;
        if (x > f || y > s) {
            ll a = (x + f - 1) / f;
            ll b = (y + s - 1) / s;
            ll mul = max(a, b);
            x = f * mul;
            y = s * mul;
        } else {
            x = f;
            y = s;
        }
    }
    ans = x + y;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'x' was not declared in this scope
   28 |     x, y;
      |     ^
a.cc:28:8: error: 'y' was not declared in this scope
   28 |     x, y;
      |        ^
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)
#define REPR(i, n) for(int i = n-1; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> t(n),a(n);
    REP(i,n) cin >> t[i] >> a[i];
    ll x = 1, y = 1, n= 1;;
    REPP(i,n-1) {
        n = max((t[i-1]*n + t[i]-1)/t[i], (a[i-1]*n + a[i]-1)/a[i]);
        x = t[i]*n, y = a[i]*n;
    }
    ll ans = x+y;
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: conflicting declaration 'll n'
   20 |     ll x = 1, y = 1, n= 1;;
      |                      ^
a.cc:17:9: note: previous declaration as 'int n'
   17 |     int n; cin >> n;
      |         ^
Language: C++


#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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; }

#define mod 1000000007LL
#define eps 0.0001
#define pi acos(-1)
#define INF 10000000000000000

#define rep(i, n) for(int i = 0;i < n;++i)
#define rep1(i, n) for(int i = 1;i < n;++i)
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define chmin

    

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // ---------------------
    // コーディング開始
    // ---------------------
    ll n;
    cin >> n;
    ll t[n],a[n];
    rep(i,n){
        cin >> t[i] >> a[i];
    }
    ll T = 1;
    ll A = 1;
    rep(i,n){
        ll T2 = T/t[i];
        ll A2 = A/a[i];
        if(T%t[i]!=0) T2++;
        if(A%a[i]!=0) A2++;
        ll N = max(T2,A2);
        T = N*t[i];
        A = N*a[i];
    }
    pri(T+A);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:10: error: incomplete type 'std::ios' {aka 'std::basic_ios<char>'} used in nested name specifier
   39 |     ios::sync_with_stdio(false);
      |          ^~~~~~~~~~~~~~~
a.cc:40:5: error: 'cin' was not declared in this scope
   40 |     cin.tie(0);
      |     ^~~
a.cc:15:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   14 | #include<bitset>
  +++ |+#include <iostream>
   15 | 
a.cc:31:16: error: 'cout' was not declared in this scope
   31 | #define pri(x) cout << (x) << "\n"
      |                ^~~~
a.cc:61:5: note: in expansion of macro 'pri'
   61 |     pri(T+A);
      |     ^~~
a.cc:31:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   31 | #define pri(x) cout << (x) << "\n"
      |                ^~~~
a.cc:61:5: note: in expansion of macro 'pri'
   61 |     pri(T+A);
      |     ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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; }

#define mod 1000000007LL
#define eps 0.0001
#define pi acos(-1)
#define INF 10000000000000000

#define rep(i, n) for(int i = 0;i < n;++i)
#define rep1(i, n) for(int i = 1;i < n;++i)
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define chmin

    

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // ---------------------
    // コーディング開始
    // ---------------------
    ll n;
    cin >> n;
    ll t[n],a[n];
    rep(i,n){
        cin >> t[i] >> a[i];
    }
    ll T = 1;
    lnt A = 1;
    rep(i,n){
        ll T2 = T/t[i];
        ll A2 = A/a[i];
        if(T%t[i]!=0) T2++;
        if(A%a[i]!=0) A2++;
        ll N = max(T2,A2);
        T = N*t[i];
        A = N*a[i];
    }
    pri(T+A);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:51:5: error: 'lnt' was not declared in this scope; did you mean 'int'?
   51 |     lnt A = 1;
      |     ^~~
      |     int
a.cc:54:17: error: 'A' was not declared in this scope
   54 |         ll A2 = A/a[i];
      |                 ^
a.cc:61:11: error: 'A' was not declared in this scope
   61 |     pri(T+A);
      |           ^
a.cc:31:25: note: in definition of macro 'pri'
   31 | #define pri(x) cout << (x) << "\n"
      |                         ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int xRatio[]=new int[n];
    int yRatio[]=new int[n];
    int x[]=new int[n];
    int y[]=new int[n];
    for(int i=0;i<n;i++){
      xRatio[i]=sc.nextInt();
      yRatio[i]=sc.nextInt();
    }
    sc.close();
    x[0]=xRatio[0];
    y[0]=yRatio[0];
    for(int i=1;i<n;i++){
      double ratio1=Math.ceil((double)x[i-1]/xRatio[i]);
      double ratio2=Math.ceil((double)y[i-1]/yRatio[i]);
      double ratio=Math.max(ratio1,ratio2);
      x[i]=(int)xRatio[i]*(int)ratio;
      y[i]=(int)yRatio[i]*(int)ratio;
    }
    System.out.println(x[i]+y[i]);
  }
}

Compiler output:
Main.java:24: error: cannot find symbol
    System.out.println(x[i]+y[i]);
                         ^
  symbol:   variable i
  location: class Main
Main.java:24: error: cannot find symbol
    System.out.println(x[i]+y[i]);
                              ^
  symbol:   variable i
  location: class Main
2 errors
Language: C++

int main() {
    int n;
    cin >> n;
    int a[n], b[n];
    for (int i = 0; i < n; i++)
        cin >> a[i] >> b[i];
    ll l = a[0], r = b[0];
    for (int i = 1; i < n; i++) {
        ll x = a[i], y = b[i];
        ll a1 = l / x + (l % x == 0 ? 0 : 1);
        ll a2 = r / y + (r % y == 0 ? 0 : 1);
        ll k = max(a1, a2);
        l = x * k;
        r = y * k;
    }
    cout << l + r;
}

main()

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n;
      |     ^~~
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll l = a[0], r = b[0];
      |     ^~
a.cc:9:11: error: expected ';' before 'x'
    9 |         ll x = a[i], y = b[i];
      |           ^~
      |           ;
a.cc:10:11: error: expected ';' before 'a1'
   10 |         ll a1 = l / x + (l % x == 0 ? 0 : 1);
      |           ^~~
      |           ;
a.cc:11:11: error: expected ';' before 'a2'
   11 |         ll a2 = r / y + (r % y == 0 ? 0 : 1);
      |           ^~~
      |           ;
a.cc:12:11: error: expected ';' before 'k'
   12 |         ll k = max(a1, a2);
      |           ^~
      |           ;
a.cc:13:9: error: 'l' was not declared in this scope
   13 |         l = x * k;
      |         ^
a.cc:13:13: error: 'x' was not declared in this scope
   13 |         l = x * k;
      |             ^
a.cc:13:17: error: 'k' was not declared in this scope
   13 |         l = x * k;
      |                 ^
a.cc:14:9: error: 'r' was not declared in this scope
   14 |         r = y * k;
      |         ^
a.cc:14:13: error: 'y' was not declared in this scope
   14 |         r = y * k;
      |             ^
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << l + r;
      |     ^~~~
a.cc:16:13: error: 'l' was not declared in this scope
   16 |     cout << l + r;
      |             ^
a.cc:16:17: error: 'r' was not declared in this scope
   16 |     cout << l + r;
      |                 ^
a.cc: At global scope:
a.cc:19:7: error: expected constructor, destructor, or type conversion at end of input
   19 | main()
      |       ^
Language: C++

#include<iostresm>
#include<cmath>
using namespace std;

int main{
  int N,T[],A[],i,t=1,a=1,addt=0,adda=0;
  cin>>N;
  T = new int[N];
  A = new int[N];
  
  for(i=0;i<N;i++){
    cin>>T[i]>>A[i];
  }
  t=T[0];
  a=A[0];
    for(i=1;i<N;i++,addt=0,adda=0){
	while(fmod(((a+adda),A[i]))==0){
      adda++;
    }
      addt=T[i]*(a+adda)/A[i]-t;
      a+=adda;
      t+=addt;
  }
  cout << a+t<<endl;
  return 0;
}
  

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

#include<cstdio>
int main(){
  int n;
  scanf("%d", &n);
  
  int t[n], a[n];
  for(int i=0; i<n; i++){
    scanf("%d %d", &t[i], &a[i]);
  }
  
  long long T, A, n;
  for(int i = 0; i < n; i++){
    if(i == 0){
      n = 1;
    } 
    else{
      long long x = T / t[i];
      long long y = A / a[i];
      if(x != 0) x++;
      if(y != 0) y++;
      
      n = max(x,y);
    }
    T = t[i] * n;
    A = a[i] * n;
  }
  printf("%d", T+A);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: conflicting declaration 'long long int n'
   11 |   long long T, A, n;
      |                   ^
a.cc:3:7: note: previous declaration as 'int n'
    3 |   int n;
      |       ^
a.cc:22:11: error: 'max' was not declared in this scope
   22 |       n = max(x,y);
      |           ^~~