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

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;

public class MainD {
	static FastScanner sc;
	static PrintWriter out;
	public static void main(String[] args){
		sc = new FastScanner();
		out = new PrintWriter(System.out);
		out.println(solve());
		out.flush();
	}

	static int solve(){
		int N = sc.nextInt();
		int M = sc.nextInt();
		int rootM = (int)Math.sqrt(M);
		List<Integer> divList = new ArrayList<>();
		for(int i=1;i<=rootM;i++){
			if(M%i==0)divList.add(i);
		}
		int div = M/N;
		for(int i=divList.size()-1;i>=0;i--){
			if(divList.get(i)<div){
				return divList.get(i);
			}
		}
		return 1;
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
	public String next() {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) nl;
	}
	public double nextDouble() { return Double.parseDouble(next());}
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.stream.Stream;

public class Main {
    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static PrintWriter pw = new PrintWriter(System.out);
    public static void main(String[] args) throws IOException {
        func();
        pw.flush();
        return;
    }

    static void func() throws IOException {
        int[] input = arrayOfInt();
        int n = input[0];
        int m = input[1];

        int MAX = Math.floorDiv(m,n);
        long ans = 1;
//        for(int i = 2;i <= Math.sqrt(m);i++){
//            if (m%i != 0) continue;
//            if(i <= MAX) ans = Math.max(ans,i);
//            if(m/i <= MAX) ans = Math.max(ans,m/i);
//        }
        for (int i = 2; i <= Math.sqrt(m); ++i) {
            if (M % i != 0) continue;
            if(i <= MAX) ans = Math.max(ans,i);
            if (m / i <= MAX) ans = Math.max(ans,m/i);
        }
        println(ans);
    }
    // 入力受け取り
    static String next() throws IOException {return br.readLine();}
    static int nextInt() throws IOException{return getInt(br.readLine());}
    static long nextLong() throws IOException{return getLong(br.readLine());}
    static String[] arrayOfString() throws IOException{return br.readLine().split(" ");}
    static int[] arrayOfInt() throws IOException{return toIntArray(arrayOfString());}
    // 変換
    static long getLong(String val) {return Long.parseLong(val);}
    static int getInt(String val) {return Integer.parseInt(val);}
    static int[] toIntArray(String[] array) {return Stream.of(array.clone()).mapToInt(Integer::parseInt).toArray();}
    static String joinToString(String[] array) {
        StringBuilder sb = new StringBuilder();
        for(int i = 0;i < array.length;i++) sb.append(array[i]);
        return sb.toString();
    }

    // 出力
    static void println(Object val){pw.println(val);}
}

Compiler output:
Main.java:29: error: cannot find symbol
            if (M % i != 0) continue;
                ^
  symbol:   variable M
  location: class Main
1 error
Language: C++

#include <stdio.h>

long long main(){
	long long a,b;
	scanf("%lld %lld",&a,&b);
	long long res = b/a;
	long long i=res;
	while((res)%i !=0){
		i--;
	}

	printf("%lld\n",res);
	return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

n, m = map(int, input().split())

ans = 1

a = 1

while(a * a <= m):

    if m % a != 0:
        a += 1
        continue
    
    b = m / a

    if a * n <= m:
        ans = max(ans, a)
    if b * n <= m:
        ans = max(ans, b)
    
    a += 1

print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = map(int, input().split())
      | ^
Language: C++

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

int main(void){

  int k,m,n,i,tmp;
  int sum; 
  
  cin>>n;
  cin>>m;
  k=sqrt((double)m);
  for(i=2;i=<k;i++){
    if(m%i==0){
      tmp=max(i,m/i);   
      if(n<=tmp){
        cout<<tmp<<endl;
        break;
      }
   }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before '<' token
   12 |   for(i=2;i=<k;i++){
      |             ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long m = sc.nextLong();
        
        for (int i = m/n; i >= 2 ; i--) {
            if (m%i == 0) {
                System.out.println(i);
                break;
            }
        }

        sc.close();
    }
}


Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from long to int
        for (int i = m/n; i >= 2 ; i--) {
                      ^
1 error
Language: C++

#include<iostream>
#define int long long
using namespace std;
signed main() {
	int n, m; cin >> n >> m;
	int p = 1;
	for (int i = 1; i <= sqrt(m); i++) {
		if (m%i == 0) {
			if (n*(m / i) <= m) {
				cout << m / i << endl;
				return 0;
			}
			else if (n*i <= m)p = i;
		}
	}
	cout << p << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int a[10000];
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    int pos=0,o=m;
    if(m%n==0)
    {
        printf("%d\n",m/n);
        return 0;
    }
    for(int i=2;i*i<=o;i++)
    {
        if(m%i==0)
        {
            a[pos++]=i;
            while(m%i==0) m/=i;
        }
    }
    if(m>1) a[pos++]=m;
    m=o;
    if(pos==1&&a[0]==m)
    {
        printf("1\n");
        return 0;
    }
    for(int i=pos-1;i>=0;i--)
    {
        int k=n*a[i];
        if(k<=m)
        {
            int h=m-k;
            if(h*n<m)
        }
    }
    printf("1\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: expected primary-expression before '}' token
   36 |         }
      |         ^
Language: C++

std::vector<int> enum_div(int n)//nの約数を列挙
{
	std::vector<int> ret;
	for(int i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}

Compiler output:
a.cc:1:6: error: 'vector' in namespace 'std' does not name a template type
    1 | std::vector<int> enum_div(int n)//nの約数を列挙
      |      ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | std::vector<int> enum_div(int n)//nの約数を列挙
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  int ans=1;
  for (int a = 1; a * a <= m; a++) {
    if (m % a != 0) {
      continue;
    }
    int b = m / a;
    if ((long)a * n <= m) {
      ans = max(a,ans);
    }
    if (long)b * n <= m) {
      ans = max(b,ans);
    }
  }
  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected unqualified-id before ')' token
   15 |     if (long)b * n <= m) {
      |             ^
a.cc:15:24: error: expected ';' before ')' token
   15 |     if (long)b * n <= m) {
      |                        ^
      |                        ;
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  int ans=1;
  for (int a = 1; a * a <= m; a++) {
    if (m % a != 0) {
      continue;
    }
    int b = m / a;
    if ((long)a * n <= m) {
      ans = max(a,ans);
    }
    if (long}b * n <= m) {
      ans = max(b,ans);
    }
  }
  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected unqualified-id before '}' token
   15 |     if (long}b * n <= m) {
      |             ^
a.cc:15:13: error: expected ')' before '}' token
   15 |     if (long}b * n <= m) {
      |        ~    ^
      |             )
a.cc:15:13: error: expected primary-expression before '}' token
a.cc:15:14: error: 'b' was not declared in this scope
   15 |     if (long}b * n <= m) {
      |              ^
a.cc: At global scope:
a.cc:19:3: error: 'cout' does not name a type
   19 |   cout << ans << endl;
      |   ^~~~
a.cc:21:3: error: expected unqualified-id before 'return'
   21 |   return 0;
      |   ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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

int main(){
	int N,M;
	cin >> N >> M;
	for(int A=1;A*A<=M;a++){
		if(M%A!=0) continue;
		int B = M/A;

		if(A*N<=M) ans = max(ans,A);
		if(B*N<=M) ans = max(ans,B);
	}
	cout << ans <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: 'a' was not declared in this scope
    7 |         for(int A=1;A*A<=M;a++){
      |                            ^
a.cc:11:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |                 if(A*N<=M) ans = max(ans,A);
      |                            ^~~
      |                            abs
a.cc:12:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |                 if(B*N<=M) ans = max(ans,B);
      |                            ^~~
      |                            abs
a.cc:14:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         cout << ans <<endl;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1e5 + 5;

vector<int> prime;

int main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 1; i * i <= m; i++) {
        if (m % i == 0) {
            if (m == i * i)
                prime.push_back(i);
            else {
                prime.push_back(i);
                prime.push_back(m / i);
            }
        }
    }
    int ans = 1;
    for (int i = 0; i < prime.size(); i++) 
        if (n <= m / prime[i]) {
            ans = max(ans, prime[i]);
    cout << ans << endl;
    return 0;
}


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

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

int main(void) {
	int n, m;
	int i,k,ans,q,mod;
	scanf("%d%d", &n, &m);
	mod = m %n ;
	q = m / n;
	if (mod == 0) {
		pritnf("%d",q);
	}
	else {
		for (i = q; i > 0; i--) {
			vector<int> v(n, i);
			v[n - 1] = m - (n - 2)*i;
			if (v[n - 1] % i == 0) {
				ans = i;
				break;
			}
		}
		printf("%d",ans);
	}
	return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   11 |                 pritnf("%d",q);
      |                 ^~~~~~
      |                 printf
Language: C++

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

int main(void) {
	int n, m;
	int i,k,ans,q,mod;
	scanf("%d%d", &n, &m);
	mod = m %n ;
	q = m / n;
	if (mod = 0) {
		pritnf("%d", q);
	}
	else {
		for (i = q; i > 0; i--) {
			vector<int> v(n, i);
			v[n - 1] = m - (n - 2)*i;
			if (v[n - 1] % i == 0) {
				ans = i;
				break;
			}
		}
		printf("%d", &ans);
	}
	return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   11 |                 pritnf("%d", q);
      |                 ^~~~~~
      |                 printf
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}


int main(void){
	int n,m,i,d=INF;
	cin >> n >> m;
	i=1;
	while(i*i<=m){
		if(m%i==0){
			if(i>=n){
				d = min(d,m/i);
			if((m/i)>=n){
				d = min(d,m/i);
			}
		}
		++i;
	}
	cout << (m/d) << endl;
	return 0;
}


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

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}


int main(void){
	int n,m,i,d=INF;
	cin >> n >> m;
	i=1;
	while(i*i<=m){
		if(m%i==0){
			if(i>=n){
				ans = min(d,i);
			}
			if((m/i)>=n){
				ans = min(d,m/i);
			}
		}
		++i;
	}
	cout << (m/d) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |                                 ans = min(d,i);
      |                                 ^~~
      |                                 abs
a.cc:33:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |                                 ans = min(d,m/i);
      |                                 ^~~
      |                                 abs
Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

int main() {
	int N, int M;
	cin >> N >> M;
	int max = M / N;

	for (int i = max; i > 0; i--) {
		if (M%i == 0) {
			cout << i;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected unqualified-id before 'int'
    9 |         int N, int M;
      |                ^~~
a.cc:10:21: error: 'M' was not declared in this scope
   10 |         cin >> N >> M;
      |                     ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

int main() {
	int N, int M;

	int max = M / N;

	for (int i = max; i > 0; i--) {
		if (M%i == 0) {
			cout << i;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected unqualified-id before 'int'
    9 |         int N, int M;
      |                ^~~
a.cc:11:19: error: 'M' was not declared in this scope
   11 |         int max = M / N;
      |                   ^
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)

typedef long long ll;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin >> n >> m;
    ll ans = 1;
    if(n==1){
        cout << m << endl;
        return 0;
    }
    for(int i=1;i*i<=m;i++){
        if(m%i==0){
            if(i<=m/n){
                ans = max(i,ans);
            }
            if(m/i<=m/n){
                ans = max(m/i,ans);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: no matching function for call to 'max(int&, ll&)'
   24 |                 ans = max(i,ans);
      |                       ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:   template argument deduction/substitution failed:
a.cc:24:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   24 |                 ans = max(i,ans);
      |                       ~~~^~~~~~~
/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, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:24:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |                 ans = max(i,ans);
      |                       ~~~^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
    using namespace std;
 
    int main(){
      int n,m;
      cin >> n >> m;
      if(m%n==0)cout << m/n << endl;
      else cout << m/n << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: expected '}' at end of input
   29 |       else cout << m/n << endl;
      |                                ^
a.cc:25:15: note: to match this '{'
   25 |     int main(){
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
   int n.m,ans=0;
  cin>>n>>m;
 
  for(int i=1;i*i<=m;i++)
  {
      if(m%i==0)
      {
         int fact1=i,fact2=m/i;
         if(fact1*n<=m)
           ans=max(fact1,ans);
         if(fact2*n<=m)
          ans=max(fact2,ans);
      }
  }
cout<<ans;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before '.' token
    6 |    int n.m,ans=0;
      |         ^
a.cc:7:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   cin>>n>>m;
      |        ^
      |        yn
a.cc:7:11: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |   cin>>n>>m;
      |           ^
      |           tm
a.cc:15:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |            ans=max(fact1,ans);
      |            ^~~
      |            abs
a.cc:17:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |           ans=max(fact2,ans);
      |           ^~~
      |           abs
a.cc:20:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 | cout<<ans;
      |       ^~~
      |       abs
Language: C++

#include <iostream>

int main()
{
  	int N, M;
	int max = M / N;

	int ans = 1;

	for (int i = 2; i < max; ++i)
	{
		if (M % i == 0)
			ans = i;
	}

	cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |         cout << ans << endl;
      |         ^~~~
      |         std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |         cout << ans << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<cmath>
int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=sqrt(m);i>=1;i--)
	{
		if(m%i==0)
		{
			int t=m/i;
			if(t>=n)
			{
				cout<<i<<endl;
				break;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>n>>m;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:33: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |                                 cout<<i<<endl;
      |                                 ^~~~
      |                                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |                                 cout<<i<<endl;
      |                                          ^~~~
      |                                          std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.Scanner;
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long G=M/N+1;while(m%g!=0){G--;System.out.println(G);break;}}}

Compiler output:
Main.java:2: error: cannot find symbol
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long G=M/N+1;while(m%g!=0){G--;System.out.println(G);break;}}}
                                                                                                                                           ^
  symbol:   variable m
  location: class Main
Main.java:2: error: cannot find symbol
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long G=M/N+1;while(m%g!=0){G--;System.out.println(G);break;}}}
                                                                                                                                             ^
  symbol:   variable g
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long G=M/N;while(m%g!=0){G--;System.out.println(G);break;}}}

Compiler output:
Main.java:2: error: cannot find symbol
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long G=M/N;while(m%g!=0){G--;System.out.println(G);break;}}}
                                                                                                                                         ^
  symbol:   variable m
  location: class Main
Main.java:2: error: cannot find symbol
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long G=M/N;while(m%g!=0){G--;System.out.println(G);break;}}}
                                                                                                                                           ^
  symbol:   variable g
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
class Main{
public static void main(String[] a){
Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}

Compiler output:
Main.java:4: error: cannot find symbol
Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                ^
  symbol:   variable m
  location: class Main
Main.java:4: error: cannot find symbol
Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                  ^
  symbol:   variable n
  location: class Main
Main.java:4: error: cannot find symbol
Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                          ^
  symbol:   variable m
  location: class Main
Main.java:4: error: break outside switch or loop
Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                                                           ^
4 errors
Language: Java

import java.util.Scanner;
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}

Compiler output:
Main.java:2: error: cannot find symbol
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                                                               ^
  symbol:   variable m
  location: class Main
Main.java:2: error: cannot find symbol
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                                                                 ^
  symbol:   variable n
  location: class Main
Main.java:2: error: cannot find symbol
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                                                                         ^
  symbol:   variable m
  location: class Main
Main.java:2: error: break outside switch or loop
class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long g=m/n;while(m%g!=0)g--;System.out.println(g);break;}}
                                                                                                                                                                          ^
4 errors
Language: C++

int main()
{
	ios::sync_with_stdio(false);
	int num, m, i, j, k, max, maxkari, cy, height,he;
	cin >> num >> m;
	max = m / num;
	for (i = max; i >= 0; i--) {
		if (m%i == 0) {
			he = i;
			break;
		}
	}
	cout << he;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'ios' has not been declared
    3 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> num >> m;
      |         ^~~
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << he;
      |         ^~~~
Language: C++

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

int64_t N,M,i;

vector< int64_t > ediv(int64_t n){
  vector< int64_t > ret;
  for(i = 1;i*i <= n;i++){
    if(n%i == 0){
      ret.push_back(i);
      if(i != 1 && i*i != n){
        ret.push_back(n/i);
      }
    }
  }
  ret.push_back(n);
  return ret;
}
int64_t mn = LINF;
int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  cin >> N >> M;
  for(auto i: ediv(M)){
    if(i >= N){
      mn = min(mn, i);
    }
  }
  cout << M/mn << endl;
  return 0;
}

Compiler output:
a.cc:19:14: error: 'LINF' was not declared in this scope
   19 | int64_t mn = LINF;
      |              ^~~~
Language: C

#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	ll n, m;
	cin >> n >> m;
	for(int i=n; i<1e9; i++){
		if(m%i==0){
			cout << m/i << endl;
			return 0;
		}
	}

	return 0;
}


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

#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int gcd(int a,int b){
  if(a<0||b<0)return 0;
  if(a>b)return gcd(a-b,b);
  else if(a<b)return gcd(b-a,a);
  else return a;
}
int main(){
  int n,m;
  cin>>n>>m;
  int max_=1;
  for(int i=m/n;i>0;--i){
    max_=gcd(max_,gcd(i,m-i*(n-1)));
  }
  //int max_=max(gcd(m/n,m/n+m%n),gcd(m/n+1,m-(m/n+1)*(n-1)));
  cout<<max_<<endl;
  return 0;
}
~

Compiler output:
a.cc:22:2: error: expected class-name at end of input
   22 | ~
      |  ^
Language: C++

#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int gcd(int a,int b){
  if(a<0||b<0)return 0;
  if(a>b)return gcd(a-b,b);
  else if(a<b)return gcd(b-a,a);
  else return a;
}
int main(){
  int n,m;
  cin>>n>>m;
  int max=max(gcd(m/n,m/n+m%n),gcd(m/n+1,m-(m/n+1)*(n-1));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:58: error: expected ')' before ';' token
   14 |   int max=max(gcd(m/n,m/n+m%n),gcd(m/n+1,m-(m/n+1)*(n-1));
      |              ~                                           ^
      |                                                          )
Language: C++

#include<stdio.h>

int main(void) {

	int N, M;

	int i;

	scanf_s("%d %d", &N, &M);

	for (i = 0; ; i++) {

		if (M % (N + i) == 0) {

			printf("%d\n", M / (N+i) );

			return 0;

		}

	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         scanf_s("%d %d", &N, &M);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

int N, M;

int main(void)
{
    cin >> N >> M;
    int out = 0;
    for (int i = ; i <= M; i++)
    {
        if (i > M / N)
        {
            break;
        }
        if (M % i == 0)
        {
            out = i;
        }
    }
    cout << out;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected primary-expression before ';' token
   14 |     for (int i = ; i <= M; i++)
      |                  ^
Language: C++

#include <iostream>
using namespace std;
int gcd(int a,int b){
  if(a>b)return gcd(a-b,b);
  else if(a<b)return gcd(b-a,a);
  else return a;
}
int main(){
  int n,m;
  cin>>n>>m;
  cout<<gcd(m/n,m/n+m%n)<<endl;
  return 0;
  

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

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


int main(){
  int n, m;
  cin >> n >> m;
  
  int ans = 1;
  for(int i=1; i *i <= m; --i){
    if(m % i == 0 ){
      if(m / i >= n){
	ans = max(ans, i);
      }

      if(m / (m / i) >= n){
	ans = max(ans, m/i);
      }
    }

    )
  }

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: expected primary-expression before ')' token
   21 |     )
      |     ^
Language: C++

#include<iostream>
using namespace std;

int main() {
	int n, m;
	scanf("%d%d",&n,&m);
	int ans = 1;
	for (int i = 2; i*n <= m; i++) {
		if ((m - i * n) % i==0)ans = i;
	}
	print("%d\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   11 |         print("%d\n",ans);
      |         ^~~~~
      |         printf
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String[] args){
  	Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int M = scan.nextInt();
    int ans = 1;
    if(N == 1){
      System.out.println(M);
    }else{
      int thr = Math.ceil((double)M / N);
      for(int i = 2; i <= thr; i++){
      	if(M % i == 0){
          ans = i;
        }
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from double to int
      int thr = Math.ceil((double)M / N);
                         ^
1 error
Language: C++

#include <cstdlib>
#include <iostream>
#include <string>
#include <time.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <vector>
#include <functional>
//#include "bits/stdc++.h"
using namespace std;
//using namespace std::vector;
#define rep(i,a,b) for(int i=(a);i<(b);++i)

#define huge 1000000007
typedef long long ll;
ll gcd(ll a, ll b);

int main(void) {

	ll N = 0;
	ll A = 0;
	ll B = 0;
	ll C = 0;
	ll D = 0;
	ll T = 0;
	//ll M = 0;
	ll c[100] = {};
	ll t[100] = {};
	ll v[3] = {};
	//ll *a, *b, *x;
	//string S, T, U[52];
	ll count = 0;
	ll sum = 0;
	ll min = 1;
	ll max = 0;
	int flag = 0;
	char temp, head;
	//int is = 0;

	//vector<int> c(3);
	//char p;






	//cin >> S;

	//a = (ll *)malloc(M * sizeof(ll));
	//b = (ll *)malloc(M * sizeof(ll));
	//vector<pair<int,int>> ch(50);

	//vector<bool> flag(N);

	cin >> N >> T;
      max = T / N + 1;
	
  if(T/N==0){
    cout << T/N << endl;
  return 0;
  }
  if(max>100000000)
    min = 10000000;
    max = 50000000;
  }
      rep(i,min,max){
     if(T%i == 0)
      sum = i;
}


	
	
		cout << sum<< endl;
	
	return 0;

}


Compiler output:
a.cc:15:20: error: expected unqualified-id before 'for'
   15 | #define rep(i,a,b) for(int i=(a);i<(b);++i)
      |                    ^~~
a.cc:70:7: note: in expansion of macro 'rep'
   70 |       rep(i,min,max){
      |       ^~~
a.cc:70:11: error: 'i' does not name a type
   70 |       rep(i,min,max){
      |           ^
a.cc:15:34: note: in definition of macro 'rep'
   15 | #define rep(i,a,b) for(int i=(a);i<(b);++i)
      |                                  ^
a.cc:15:40: error: expected unqualified-id before '++' token
   15 | #define rep(i,a,b) for(int i=(a);i<(b);++i)
      |                                        ^~
a.cc:70:7: note: in expansion of macro 'rep'
   70 |       rep(i,min,max){
      |       ^~~
a.cc:78:17: error: 'cout' does not name a type
   78 |                 cout << sum<< endl;
      |                 ^~~~
a.cc:80:9: error: expected unqualified-id before 'return'
   80 |         return 0;
      |         ^~~~~~
a.cc:82:1: error: expected declaration before '}' token
   82 | }
      | ^
Language: C++

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

int main() {
    long n, m;
    cin >> n >> m;
    long ans = 1;
    for (long i = 2; i * i <= t; i++) {
        long r = m % i;
        if (r == 0) {
            if (m >= i * n)
                ans = max(i, ans);
            if (m >= (m / i) * n)
                ans = max(m / i, ans);
        }
    }
    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: 't' was not declared in this scope
    9 |     for (long i = 2; i * i <= t; i++) {
      |                               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N,M;
int main(){
  cin >> N >> M;
  if(M%N == 0){
    cout << N << endl;
    return 0;
  }

  for(int i=M/N;i>=1;i--){
    if((M % i == 0){
      cout << i <<endl;
      return 0;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ')' before '{' token
   12 |     if((M % i == 0){
      |       ~            ^
      |                    )
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^
Language: C++

#Include<iostream>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
for(int i=m/n;i>=0;i--)
{
if(m%i==0)
{
cout<<i<<endl;
break;
}
}
return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin>>n>>m;
      | ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #Include<iostream>
a.cc:11:1: error: 'cout' was not declared in this scope
   11 | cout<<i<<endl;
      | ^~~~
a.cc:11:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:10: error: 'endl' was not declared in this scope
   11 | cout<<i<<endl;
      |          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #Include<iostream>
Language: C++

#Include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
for(int i=m/n;i>=0;i--)
{
if(m%i==0)
{
cout<<i<<endl;
break;
}
}
return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin>>n>>m;
      | ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #Include<bits/stdc++.h>
a.cc:11:1: error: 'cout' was not declared in this scope
   11 | cout<<i<<endl;
      | ^~~~
a.cc:11:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:10: error: 'endl' was not declared in this scope
   11 | cout<<i<<endl;
      |          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #Include<bits/stdc++.h>
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n, m;
  cin >> n >> m;
  int gcd = 1;
  for ( int i = 2; i <= m; i++ ){
    //int a = m / i, b = m % i;
    if ( m / i < n ) break;
    if ( m % i != 0 ) continue;
    if ( i == tmp ) continue;
    int tmp;
    if ( ( m / i ) % n == 0 ) tmp = m / n;
    else tmp = i;
    if ( gcd < tmp ) gcd = tmp;
  }
  
  cout << gcd << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   13 |     if ( i == tmp ) continue;
      |               ^~~
      |               tm
Language: C++

import java.awt.Point;
import java.util.ArrayDeque;
import java.util.Scanner;
import java.util.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;
import java.util.Collection;



public class Main{

        static final Scanner sc=new Scanner(System.in);






        public static void main(String[]args){
          long N=sc.nextInt();
          long M=sc.nextLong();
          ArrayList<Long>list=new ArrayList<>();
          for(long i=1 ; i*i<=M ; ++i){
		          if(M%i == 0){
			            list.add(i);
			            if(i!=1 && i*i!=M)
			            {
				          list.add(M/i);
			}
		}
	        }
          long max=1;
          for(long i:list){
            if(i>max&&i>N){
              long x=i*N;
              if(x<=M){
                max=i;
              }
            }
            
          }
          if(N==1){
            System.out.println(N);
          }else{
          System.out.println(max);}



          
    }






                



        }





Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.awt.Point;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.ArrayDeque;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Scanner;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.Arrays;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.util.ArrayList;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.util.Set;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
    8 | import java.util.HashSet;
      | ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: 'import' does not name a type
    9 | import java.util.Collection;
      | ^~~~~~
a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:13:1: error: expected unqualified-id before 'public'
   13 | public class Main{
      | ^~~~~~
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int t=m;
    int now=1;
    int k=m/n;
    int i;
    if(n==1%%m==1000000000)
        now=m;
    else
    for(i=k;i>=2;i--)
    {
        if(m%i==0&&t/(now*i)>=n)
        {
            m=m/i;
            now*=i;
            i++;
        }
    }
    cout<<now;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before '%' token
   12 |     if(n==1%%m==1000000000)
      |             ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int t=m;
    int now=1;
    int k=m/n;
    int i;
    if(n==1%%m=1000000000)
        now=m;
    else
    for(i=k;i>=2;i--)
    {
        if(m%i==0&&t/(now*i)>=n)
        {
            m=m/i;
            now*=i;
            i++;
        }
    }
    cout<<now;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before '%' token
   12 |     if(n==1%%m=1000000000)
      |             ^
Language: C++

#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

long long n,m,mt;
map<int, int> cnt;
vector<long long> v;

void process(map<int, int>::iterator it, long long t){
    if(it == cnt.end()){
        if(t >= n) v.push_back(t);
        return;
    }
    for(int i=0; i <= it->second; i++){
        long long tmp =  t * pow(it->first,i);
        p(next(it), tmp);
    }
    return;
}

bool isPrime(long long m){
    for(int i=2; i*i <= m; i++){
        if(m%i == 0) return false;
    }
    return m != 1;
}

int main()
{
    cin >> n >> m;
    mt = m;
    if(isPrime(m)){
        cout << 1 << endl;
        return 0;
    }
    
    for(int i=2; i<=m && m!=1; i++){
        while(m%i == 0){
            if(cnt.count(i) == 0) 
                cnt[i] = 1;
            else
                cnt[i]++;
            m = m/i;
        }
    }
    process(cnt.begin(), 1);
    sort(v.begin(), v.end());
    cout << mt/v[0] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void process(std::map<int, int>::iterator, long long int)':
a.cc:19:9: error: 'p' was not declared in this scope
   19 |         p(next(it), tmp);
      |         ^
Language: C++

int main(){
 int m, n;
 std::cin >> n >> m;
 int i =  m / n;
 while true{
   if (m % i == 0){
     break; 
   }else{
     i -= 1;  
   }
 }
 std::cout << i << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:7: error: 'cin' is not a member of 'std'
    3 |  std::cin >> n >> m;
      |       ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:5:8: error: expected '(' before 'true'
    5 |  while true{
      |        ^~~~
      |        (
a.cc:5:12: error: expected ')' before '{' token
    5 |  while true{
      |        ~~~~^
      |            )
a.cc:12:7: error: 'cout' is not a member of 'std'
   12 |  std::cout << i << std::endl;
      |       ^~~~
a.cc:12:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:25: error: 'endl' is not a member of 'std'
   12 |  std::cout << i << std::endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(){
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int n,m;
    cin >> n >>m;
    k = 1;
    while(m%n !=0){
        n+=k;
        if(n%(m%n)==0){
            k = m%n;
        }
    }
    cout << m/n;
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'k' was not declared in this scope
    7 |     k = 1;
      |     ^
Language: C++

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

int main() {
    long n, m;
    cin >> n >> m;
    long ans = 1;
    long t = (long) sqrt(m);
    for (long i = 2; i <= t; i++) {
        long r = m % i;
        if (r == 0) {
            if (m >= i * n)
                ans = i;
            if (m >= (m / i) * n)
                ans = m / i;
        }
    }
    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 'sqrt' was not declared in this scope
    9 |     long t = (long) sqrt(m);
      |                     ^~~~