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

#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n,m;
long long ans=1;
int main()
{
	scanf("%d%d",&n,&m);
//	miku(m);
	for(int i=sqrt(m);i>=2;i--)
	{
		if(m%i==0)
		{
			if(m/i>=n)
			{
				ans*=i;
				m/=i;
			}
		}
	}
printf("%lld",ans);
puts("")
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: expected ';' before 'return'
   24 | puts("")
      |         ^
      |         ;
   25 |         return 0;
      |         ~~~~~~
Language: C

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

int main(void){
    long long int n, m, ans=1, i;
    scanf("%lld %lld", &n, &m);
    for(i=n; i<m; i++){
        if(m%i == 0){
            ans = m/i;
            break;
        }
        if(m/i == 2){
            if(m%i == 0){
                ans=2;
                break;
            }else{
                ans = 1;
                break;
            }
    }
    printf("%lld", ans);
}


Compiler output:
main.c: In function 'main':
main.c:22:1: error: expected declaration or statement at end of input
   22 | }
      | ^
Language: C

#include<stdio.h>

int main()
{
 long N;
 long M;
 long i;
 long factor=1;
 long divisors;
 long rem;
 long commonshares;
 long out;

 scanf("%ld %ld",&N,&M);
 if((M%2)==0)
 {
  factor=2;
 }else{
  for(i=3;i<(N+M/N);i+=2)
  {
   if((M%i)==0)
   {
    factor=i;
    break;
   }
  }  
 }
 divisors=M/factor;
 commonshares=(divisors-(divisors%N))/N;
 rem=divisors%commonshares;
 if(rem==0)
 {
  out=factor*commonshares;
 }else{
  out=factor;
 }
 printf("%ld\n",out);
 
 return 0;
}
 benson 

Compiler output:
main.c:41:1: error: stray '\302' in program
   41 | <U+00A0>benson<U+00A0><U+E0B0>
      | ^~~~~~~~
main.c:41:8: error: stray '\302' in program
   41 | <U+00A0>benson<U+00A0><U+E0B0>
      |               ^~~~~~~~
main.c:41:9: error: stray '\356' in program
   41 | <U+00A0>benson<U+00A0><U+E0B0>
      |                       ^~~~~~~~
main.c:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   41 |  benson 
      | ^
Language: C++

#include <iostream>

#define N_MAX 100000

int euclidean_gcd(int a, int b) {
  while(1) {
    if(a < b) swap(a, b);
    if(!b) break;
    a %= b;
  }
  return a;
}

using namespace std;

int main(){
    int N, M;
    int div_max = 0;
    int div_tmp;
    cin >> N >> M;
    for(int i = 1; i*i <= M; i++){
        if(M%i == 0 && (M/i) >= N){
            div_tmp = euclidean_gcd(M/i, N)*i;
            if(div_tmp > div_max){
                div_max = div_tmp;
            }
        }
    }
    cout << div_max << '\n';
}

Compiler output:
a.cc: In function 'int euclidean_gcd(int, int)':
a.cc:7:15: error: 'swap' was not declared in this scope
    7 |     if(a < b) swap(a, b);
      |               ^~~~
a.cc:7:15: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 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/tuple:2823:5: note:   'std::swap'
 2823 |     swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete;
      |     ^~~~
In file included from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
/usr/include/c++/14/bits/exception_ptr.h:229:5: note:   'std::__exception_ptr::swap'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
Language: C++


  #include "dump.hpp"
#else
  #define DUMP(...)
  #define DEBUG(...)
#endif

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
#define SZ(a) int((a).size())
#define _REP(_1,_2,_3,_4,name,...) name
#define _REP4(i,b,e,s) for(decltype(e) _b=(b),_e=(e),i=_b+(0<(s)?0:(s));(0<(s)?i<_e:_e<=i);i+=(s))
#define _REP3(i,b,e) for(decltype(e) _b=(b),_e=(e),i=(_b<_e?_b:_b-1);(_b<_e?i<_e:_e<=i);(_b<_e?i++:i--))
#define _REP2(i,n) for(decltype(n) i=0,_n=(n);i<_n;i++)
#define _REP1(n) for(decltype(n) _i=0,_n=(n);_i<_n;_i++)
#define REP(...) _REP(__VA_ARGS__,_REP4,_REP3,_REP2,_REP1)(__VA_ARGS__)
#define FOR(it,c) for(auto&& it=begin(c);it!=end(c);it++)
#define ROF(it,c) for(auto&& it=rbegin(c);it!=rend(c);it++)
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define INT(n) int n;assert(0<scanf("%d",&n))

static const int MAXP = 100000;
vector<int> ps, fs;
void init(){
  fs.reserve(1 + MAXP);
  for(int i = 0; i <= MAXP; i++){fs.push_back(i);}
  for(int i = 2; i <= MAXP; i++){
    if (fs[i] == i){
      ps.push_back(i);
      for (int j = i; j <= MAXP; j += i){
        fs[j] = min(fs[j], i);
      }
    }
  }
}
bool isprime(const long long& n){
  if (n <= MAXP){
    return (1 < n && fs[n] == n);
  } else {
    for(int p: ps){
      if (n % p == 0){return false;}
    }
    return true;
  }
}

int main(){
  init();
  INT(n); INT(m);
  int ans = 1;
  if (!isprime(m)){
    REP(i, n, m + 1){
      if (m % i == 0){
        ans = m / i;
        break;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}

Compiler output:
a.cc:2:12: fatal error: dump.hpp: No such file or directory
    2 |   #include "dump.hpp"
      |            ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define Would
#define you
#define please


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

	int N, M;
	cin >> N >> M;

	int M0 = M;
	int X[40000] = {};
	int Y[10000] = {};
	int dokomade = 0;

	int saidai = sqrt(M);
	for (int i = 2; i < saidai + 1; i++) {
		while (M % i == 0) {
			if (Y[i] == 0) dokomade++;
			Y[i]++;
			X[dokomade] = i;
			M /= i;
		}
	}

	int kotae = 1;

	if (M != 1) {
		dokomade++;
		Y[M]++;
		X[dokomade] = M;
	}

	if (M0 == 1) co(1);
	else {

		int saidai = 1;

		rep1(i, dokomade) saidai *= (1 + Y[X[i]]);

		int kotae = 1;

		for (int i = 0; i < saidai; i++) {
			int kari = 1;

			int karii = i;
			rep(ii, dokomade) {

				kari *= pow(X[ii + 1], i % (1 + Y[X[ii + 1]]));
				karii /= (1 + Y[X[ii + 1]]);

			}

			if (M0 >= 1ll * N * kari) kotae = max(kotae, kari);
		}


		co(kotae);
	}


	Sleep(30000000);

	Would you please return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:9: error: 'Sleep' was not declared in this scope; did you mean 'sleep'?
   73 |         Sleep(30000000);
      |         ^~~~~
      |         sleep
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n,m;
    cin>>n>>m;
    ll mx=1;
    for(int i=2;i*i<=m;i++)
    {

        if(m%i==0)
        {
            ll p = 1LL*i*n;
            if(p>m)
            {
                continue;
            }

            mx = max(mx,i);
            ll k = m/i;
            ll pp = 1LL*k*n;
            if(pp>m)
            {
                continue;
            }
            mx = max(mx,k);
        }
    }
    cout<<mx<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: no matching function for call to 'max(ll&, int&)'
   20 |             mx = max(mx,i);
      |                  ~~~^~~~~~
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:20:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |             mx = max(mx,i);
      |                  ~~~^~~~~~
/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:20:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |             mx = max(mx,i);
      |                  ~~~^~~~~~
Language: C++

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

int main(){
    int N, M;
    cin >> N >> M;
    if(M % N == 0){
        cout << M / N << endl;
    }
    while (M % 2 == 0) {
        M /= 2;
    }

    for (int i = 3; i * i <= m; i += 2) {
        while (M % i == 0) {
            M /= i;
        }
    }
    cout << M << endl;
    return 0;
}

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

mを割り切れることができ、かつその商がn以上の数を求める

Compiler output:
main.c:1:24: error: stray '\343' in program
    1 | m<U+3092><U+5272><U+308A><U+5207><U+308C><U+308B><U+3053><U+3068><U+304C><U+3067><U+304D><U+3001><U+304B><U+3064><U+305D><U+306E><U+5546><U+304C>n<U+4EE5><U+4E0A><U+306E><U+6570><U+3092><U+6C42><U+3081><U+308B>
      |                                                                                          ^~~~~~~~
main.c:1:1: error: unknown type name 'm\U00003092\U00005272\U0000308a\U00005207\U0000308c\U0000308b\U00003053\U00003068\U0000304c\U00003067\U0000304d'
    1 | mを割り切れることができ、かつその商がn以上の数を求める
      | ^~~~~~~~~~~~~~~~~~~~~~~
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
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 M = sc.nextInt();
		int answer;
		for(int i=N; i<=M; i++){
			if(M%i==0){
				answer = M/i;
				break;
			}
		}
		System.out.println(answer);
		return;
	}
}

Compiler output:
Main.java:14: error: variable answer might not have been initialized
		System.out.println(answer);
		                   ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String firstLine[] = scanner.nextLine().split(" ", 2);

        int n = Integer.parseInt(firstLine[0]);
        long m = Long.parseLong(firstLine[1]);

        long max = new Main().maxNum(n, m);
        System.out.println(max);
    }

    public long maxNum(int n, long m) {
        long max = 1;
        for (long i = 2; i <= m; i++) {
            long sum = n * i;
            if (sum > m && (m - sum) % base == 0) {
                max = i;
            }
        }
        return max;
    }
}


Compiler output:
Main.java:19: error: cannot find symbol
            if (sum > m && (m - sum) % base == 0) {
                                       ^
  symbol:   variable base
  location: class Main
1 error
Language: C++

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

bool IsPrime(int num)
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			// 素数ではない
			return false;
		}
	}

	// 素数である
	return true;
}

int main()
{
	// 整数の入力
	int n, m;
	cin >> n >> m;

	long f = 1;

	for (int i = 2, len = (int)sqrt(m); i < len; i++) {
		if (!IsPrime(i)) continue;
		if ( (m % i) != 0) continue;

		int divI = (int)(m / i);

		if (divI >= n) {
			f *= i;
		}
	}

	cout << f << endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool IsPrime(int)':
a.cc:11:26: error: 'sqrt' was not declared in this scope
   11 |         double sqrtNum = sqrt(num);
      |                          ^~~~
a.cc: In function 'int main()':
a.cc:33:36: error: 'sqrt' was not declared in this scope
   33 |         for (int i = 2, len = (int)sqrt(m); i < len; i++) {
      |                                    ^~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main()
{
	ll n, m;
	cin >> n >> m;
	if (m%n == 0)
		cout << m / n << endl;
	else
	{
		ll s = m / n;
		cout << ll(sqrt(s)) << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: 'sqrt' was not declared in this scope
   17 |                 cout << ll(sqrt(s)) << endl;
      |                            ^~~~
Language: C++

n, m = gets.split.map(&:to_i)
(m / n).downto(1).each do |x|
  next if m % x != 0
  puts x
  exit
end


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

#include<bits/stdc++.h>
#pragma warning(disable:4996)
#ifdef _MSC_VER
#  define __builtin_popcount __popcnt
#endif
#define int long long
using namespace std;
using ll = long long;
using ld = long double;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const long double PI = acos(-1.0);
inline void my_io() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	cout << fixed << setprecision(15);
}
int N, M;
vector< int64_t > divisor(int64_t n) {
	vector< int64_t > ret;
	for (int64_t i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			ret.push_back(i);
			if (i * i != n) ret.push_back(n / i);
		}
	}
	sort(begin(ret), end(ret));
	return (ret);
}
signed main() {
	my_io();
	cin >> N >> M;
	vector<int>v = divisor(M);
	int ans = -1;
	for (int i = v.size() - 1; i >= 0; i--) {
		if (M / v[i] >= N) {
			ans = max(ans, v[i]);
		}
	}
	if (ans == -1) {
		cout << 1 << endl;
	}
	else cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:31: error: conversion from 'vector<long int>' to non-scalar type 'vector<long long int>' requested
   32 |         vector<int>v = divisor(M);
      |                        ~~~~~~~^~~
Language: C++

#include <stdio.h>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    ll n, m;
    while (scanf("%lld%lld", &n, &m) != EOF) {
        if (m % n == 0) { printf("%lld\n", m / n); continue; }
        else {
            ll l = 1, r = 1; r << 34;
            while (l < r) {
                ll mid = (l + r) / 2;
                ll k = m - n * mid;
                if (k < 0) r = mid;
                else if (k == 0) l = mid;
                else if (__gcd(k, mid) == mid) l = mid;
                else r = mid;
            }
            printf("%lld\n", mid);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:30: error: 'mid' was not declared in this scope
   22 |             printf("%lld\n", mid);
      |                              ^~~
Language: C++

// #include <bits/stdc++.h>
#include "lib.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF 1e18//1234567890987654321
#define INF 1234567890
#define pb push_back
#define ins insert
#define f first
#define s second
#define db 0
#define MAXN 1000006
#define MAXK 26
#define MAXX 15000006
#define ll long long
#define rep0(kk, l1, l2)for(ll kk = l1; kk < l2; kk++)
#define rep1(kk, l1, l2)for(ll kk = l1; kk <= l2; kk++)
#define forit(it, A) for(set<ll>::iterator it = A.begin(); it != A.end(); it++)
#define bg(ms) *ms.begin()
#define ed(ms) *prev(ms.end(), 1)
#define addedge(a, b, c) v[a].pb(pi(b, c)); v[b].pb(pi(a, c))
#define ph push
#define all(x) x.begin(), x.end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
ll n, m, ans=1;
vector <ll> A;
void prime_factor(ll x)
{
	if(x%2 == 0)A.pb(2);
	while(x%2 == 0)
	{
		x/=2;
	}
	ll i = 3;
	while(i <= (sqrt(x)+1))
	{
		if(x%i == 0)
		{
			while(x%i == 0)x/=i;
			A.pb(i);
		}
		else i+=2;
	}
	if(x > 1)
	{
		A.pb(x);
	}
	return;
}
bool bstar(ll num, ll x)
{
	if(num*x > m)return 0;
	ll times = m/(num*x);
	if(times >= n)return 1;
	else return 0;
}
int main()
{
	cin >> n >> m;
	prime_factor(m);
	for(ll i = 2; i <= 2; i++)
	{
		// cout << i << "\n";
		ll st = 0, en = m+10, mid = 0, real = 0;
		while(en-st > 1)
		{
			mid = ((st+en)/2);
			if(bstar(i, mid) == 1)
			{
				st = mid;
				// if(m%(i*mid) == 0)real = max(real, mid);
			}
			else en = mid;
		}
		/*for(ll j = 1; j < m/i+1; j++)
		{
			if(bstar(i, j))st = j;
		}*/
		if(st == 0)continue;
		while(m%(i*st) != 0)st /= 2;
        if(m/(i*st) >= n)ans = max(ans, st*i);
	}
	for(ll i = 3; i <= m; i+=2)
	{
		// cout << i << "\n";
		ll st = 0, en = m+10, mid = 0, real = 0;
		while(en-st > 1)
		{
			mid = ((st+en)/2);
			if(bstar(i, mid) == 1)
			{
				st = mid;
				// if(m%(i*mid) == 0)real = max(real, mid);
			}
			else en = mid;
		}
		/*for(ll j = 1; j < m/i+1; j++)
		{
			if(bstar(i, j))st = j;
		}*/
		if(st == 0)continue;
		while(m%(i*st) != 0)st /= 2;
        if(m/(i*st) >= n)ans = max(ans, st*i);
	}
	cout << ans << "\n";
}


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

#include<iostream>
#include <algorithm>
#include<string>
#include<cmath>
#include <functional>
using namespace std;
int R(int Cx, int Cy, int x, int y) {
	return abs(x-Cx)+abs(y-Cy);
}
int main(void) {
	int N,M,ans;
	cin >> N >>M;
	if (N == 1)
		ams = M;
	else if (N == 2 && M % 2 == 0)
		ans = M / 2;
	for (long int n = 1;n <=M/N +2;n++) {
		if (M%n == 0 && M / n >= N)
			ans = n;
	}
	cout << ans << endl;
	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'ams' was not declared in this scope; did you mean 'ans'?
   14 |                 ams = M;
      |                 ^~~
      |                 ans
Language: C++

// #include <bits/stdc++.h>
#include "lib.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF 1e18//1234567890987654321
#define INF 1234567890
#define pb push_back
#define ins insert
#define f first
#define s second
#define db 0
#define MAXN 1000006
#define MAXK 26
#define MAXX 15000006
#define ll long long
#define rep0(kk, l1, l2)for(ll kk = l1; kk < l2; kk++)
#define rep1(kk, l1, l2)for(ll kk = l1; kk <= l2; kk++)
#define forit(it, A) for(set<ll>::iterator it = A.begin(); it != A.end(); it++)
#define bg(ms) *ms.begin()
#define ed(ms) *prev(ms.end(), 1)
#define addedge(a, b, c) v[a].pb(pi(b, c)); v[b].pb(pi(a, c))
#define ph push
#define all(x) x.begin(), x.end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
ll n, m, ans=1;
vector <ll> A;
void prime_factor(ll x)
{
	if(x%2 == 0)A.pb(2);
	while(x%2 == 0)
	{
		x/=2;
	}
	ll i = 3;
	while(i <= (sqrt(x)+1))
	{
		if(x%i == 0)
		{
			while(x%i == 0)x/=i;
			A.pb(i);
		}
		else i+=2;
	}
	if(x > 1)
	{
		A.pb(x);
	}
	return;
}
bool bstar(ll num, ll x)
{
	if(num*x > m)return 0;
	ll times = m/(num*x);
	if(times >= n)return 1;
	else return 0;
}
int main()
{
	cin >> n >> m;
	prime_factor(m);
	for(auto i : A)
	{
		// cout << i << "\n";
		ll st = 0, en = m+10, mid = 0, real = 0;
		while(en-st > 1)
		{
			mid = ((st+en)/2);
			if(bstar(i, mid) == 1)
			{
				st = mid;
				// if(m%(i*mid) == 0)real = max(real, mid);
			}
			else en = mid;
		}
		/*for(ll j = 1; j < m/i+1; j++)
		{
			if(bstar(i, j))st = j;
		}*/
		if(st == 0)continue;
		while(m%(i*st) != 0)st /= 2;
        if(m/(i*st) >= n)ans = max(ans, st*i);
	}
	cout << ans << "\n";
}


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


#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  int M;
  cin >> M;
  
  int i_max = int(M/N);
  loop_flag = 1;
  for(int i = i_max; i > 0 && loop_flag == 1;i--){
  	if( M%i == 0){
      cout << i << endl;
      loop_flag = 0;
    }
  }
}

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

#include <stdio.h>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    ll n, m;
    while (scanf("%lld%lld", &n, &m) != EOF) {
        if (m % n == 0) { printf("%lld\n", m / n); continue; }
        else {
            ll k = __gcd(m / n, m / n + m % (m / n));
            if (m & 1 == 0 && m / n >= 2) printf("%lld\n", max(k, 2));
            else printf("%lld\n", k);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:63: error: no matching function for call to 'max(ll&, int)'
   14 |             if (m & 1 == 0 && m / n >= 2) printf("%lld\n", max(k, 2));
      |                                                            ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/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:14:63: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   14 |             if (m & 1 == 0 && m / n >= 2) printf("%lld\n", max(k, 2));
      |                                                            ~~~^~~~~~
/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:14:63: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   14 |             if (m & 1 == 0 && m / n >= 2) printf("%lld\n", max(k, 2));
      |                                                            ~~~^~~~~~
Language: C

#include <stdio.h>


int keisan(int, int);


int main(void){
    //nとmの読み取り
    int n, m;
    scanf("%d %d", &n, &m);
    //計算
    int a, b;
    a = m / n + 1;
    b = m % n - n;
    ans = keisan(a, b);
    //表示
    printf("%d\n", ans);

    return 0;
}

int keisan(int a, int b){
    a -= 1;
    b += n;
    if(b % a != 0){
        a = keisan(a, b);
    }
    return a;
}

Compiler output:
main.c: In function 'main':
main.c:15:5: error: 'ans' undeclared (first use in this function)
   15 |     ans = keisan(a, b);
      |     ^~~
main.c:15:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'keisan':
main.c:24:10: error: 'n' undeclared (first use in this function)
   24 |     b += n;
      |          ^
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include<climits>
#include <string>
#include <map>
#include <set>
#include <list>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)

using namespace std;

int i,j,k,l,m,n;
/////////////////////////////////////////////////////


ll N,M;

int main(){
    scanf("%lld%lld",&N,&M);
    if(N==1){
        printf("%lld\n",M);
        return 0;
    }
    for(ll ans=M/N;true;ans--){
        if(M%ans==0&&N<=M/ans){
            break;
        }
    }
    printf("%lld\n",ans);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |     printf("%lld\n",ans);
      |                     ^~~
      |                     abs
Language: C++

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

int main()
{
	uint32_t n, m, mi = 1;
	cin >> n >> m;
	for (uint32_t i = 2, j = min((uint32_t)sqrt(m), m / i); i <= j; i++)
		if (m%i == 0)
		{
			if (i < n && (m / i) >= n) mi = i;
			else if (i >= n)
			{
				mi = max(m / i, mi);
				break;
			}
		}
	cout << mi << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'uint32_t' was not declared in this scope
    8 |         uint32_t n, m, mi = 1;
      |         ^~~~~~~~
a.cc:4:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    3 | #include <vector>
  +++ |+#include <cstdint>
    4 | using namespace std;
a.cc:9:16: error: 'n' was not declared in this scope
    9 |         cin >> n >> m;
      |                ^
a.cc:9:21: error: 'm' was not declared in this scope; did you mean 'tm'?
    9 |         cin >> n >> m;
      |                     ^
      |                     tm
a.cc:10:22: error: expected ';' before 'i'
   10 |         for (uint32_t i = 2, j = min((uint32_t)sqrt(m), m / i); i <= j; i++)
      |                      ^~
      |                      ;
a.cc:10:65: error: 'i' was not declared in this scope
   10 |         for (uint32_t i = 2, j = min((uint32_t)sqrt(m), m / i); i <= j; i++)
      |                                                                 ^
a.cc:10:70: error: 'j' was not declared in this scope
   10 |         for (uint32_t i = 2, j = min((uint32_t)sqrt(m), m / i); i <= j; i++)
      |                                                                      ^
a.cc:13:52: error: 'mi' was not declared in this scope
   13 |                         if (i < n && (m / i) >= n) mi = i;
      |                                                    ^~
a.cc:16:33: error: 'mi' was not declared in this scope
   16 |                                 mi = max(m / i, mi);
      |                                 ^~
a.cc:20:17: error: 'mi' was not declared in this scope
   20 |         cout << mi << endl;
      |                 ^~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:12:17: note: in expansion of macro 'int'
   12 |       long long int a=m/i;
      |                 ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:12:17: note: in expansion of macro 'int'
   12 |       long long int a=m/i;
      |                 ^~~
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include<climits>
#include <string>
#include <map>
#include <set>
#include <list>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)

using namespace std;

int i,j,k,l,m,n;
/////////////////////////////////////////////////////


ll N,M;

int main(){
    scanf("%lld%lld",&N,&M);
    if(N==1){
        printf("%lld\n",M);
        return 0;
    }
    for(ans=M/2;true;ans--){
        if(M%ans==0&&N<=M/ans){
            break;
        }
    }
    printf("%lld\n",ans);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |     for(ans=M/2;true;ans--){
      |         ^~~
      |         abs
a.cc:35:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |     printf("%lld\n",ans);
      |                     ^~~
      |                     abs
Language: C++

int main() {
    unsigned int N, M;
    cin >> N >> M;

    for (unsigned int i = N; i <= M; i++){
        if (M % i == 0){
            cout << M / i << endl;
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N >> M;
      |     ^~~
a.cc:7:13: error: 'cout' was not declared in this scope
    7 |             cout << M / i << endl;
      |             ^~~~
a.cc:7:30: error: 'endl' was not declared in this scope
    7 |             cout << M / i << endl;
      |                              ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: no matching function for call to 'max(int&, long long int&)'
   14 |         Max=max(Max,a);
      |             ~~~^~~~~~~
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:14:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   14 |         Max=max(Max,a);
      |             ~~~^~~~~~~
/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:14:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |         Max=max(Max,a);
      |             ~~~^~~~~~~
Language: C

#include<iostream>
using namespace std;

int main() {
	long long n, m;
	cin >> n >> m;
	long long ans = 1;
	for (long long i = 2; i*n < m; i++) {
		if ((m - i * n) % i == 0)ans = i;
		if (i > 600000000)break;
	}
	cout << ans << endl;
}


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

// #include <bits/stdc++.h>
#include "lib.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF 1e18//1234567890987654321
#define INF 1234567890
#define pb push_back
#define ins insert
#define f first
#define s second
#define db 0
#define MAXN 1000006
#define MAXK 26
#define MAXX 15000006
#define ll long long
#define rep0(kk, l1, l2)for(ll kk = l1; kk < l2; kk++)
#define rep1(kk, l1, l2)for(ll kk = l1; kk <= l2; kk++)
#define forit(it, A) for(set<ll>::iterator it = A.begin(); it != A.end(); it++)
#define bg(ms) *ms.begin()
#define ed(ms) *prev(ms.end(), 1)
#define addedge(a, b, c) v[a].pb(pi(b, c)); v[b].pb(pi(a, c))
#define ph push
#define all(x) x.begin(), x.end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
ll n, m, ans;
vector <ll> A;
void prime_factor(ll x)
{
	if(x%2 == 0)A.pb(2);
	while(x%2 == 0)
	{
		x/=2;
	}
	ll i = 3;
	while(i <= (sqrt(x)+1))
	{
		if(x%i == 0)
		{
			while(x%i == 0)x/=i;
			A.pb(i);
		}
		else i+=2;
	}
	if(x > 1)
	{
		A.pb(x);
	}
	return;
}
bool bstar(ll num, ll x)
{
	if(num*x > m)return 0;
	ll times = m/(num*x);
	if(times >= n)return 1;
	else return 0;
}
int main()
{
	cin >> n >> m;
	prime_factor(m);
	for(auto i : A)
	{
		// cout << i << "\n";
		ll st = 0, en = (m/i)+1, mid = 0, real = 0;
		while(en-st > 1)
		{
			mid = ((st+en)/2);
			if(bstar(i, mid))
			{
				st = mid;
				if(m%(i*mid))real = mid;
			}
			else en = mid;
		}
		/*for(ll j = 1; j < m/i+1; j++)
		{
			if(bstar(i, j))st = j;
		}*/
		if(st > 0)ans = max(ans, real*i);
	}
	cout << ans << "\n";
}


Compiler output:
a.cc:2:10: fatal error: lib.h: No such file or directory
    2 | #include "lib.h"
      |          ^~~~~~~
compilation terminated.
Language: Java

import java.util.*;
import java.io.*;
class Main{
public static int gcd(int a,int b)
{
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
}
public static void main(String[] args)throws IOException {
    FastReader in=new FastReader(System.in);
    int n=in.nextInt();
    int m=in.nextInt();
    int x=m/n;
    if(m%n==0)
    System.out.println(x);
    else
    {
        int y=m-(n*x);
        System.out.println(gcd(y,x)));
        /*else
        System.out.println("1");*/
    }
}
}
class FastReader {
 
    byte[] buf = new byte[2048];
    int index, total;
    InputStream in;
 
    FastReader(InputStream is) {
        in = is;
    }
 
    int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    }
 
    String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan());
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }
    String nextLine() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan());
        StringBuilder sb = new StringBuilder();
        for (; c !=10; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }
    char nextChar() throws IOException{
        int c;
         for (c = scan(); c <= 32; c = scan());
         return (char)c;
        }
 
    int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan());
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
 
    long nextLong() throws IOException {
        int c;
        long val = 0;
        for (c = scan(); c <= 32; c = scan());
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
}

Compiler output:
Main.java:20: error: ';' expected
        System.out.println(gcd(y,x)));
                                    ^
1 error
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void){
  int n,m;
  int min;
  int i,j,k;
  int ans=0;
  scanf("%d %d",&n,&m);

  for(i=0;i<m/2;i++){
    if(m%(i+n)==0){
      printf("%d\n",m/(i+n));
      return 0;
    }
  }
  printf("1\n")
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:16: error: expected ';' before 'return'
   18 |   printf("1\n")
      |                ^
      |                ;
   19 |   return 0;
      |   ~~~~~~
Language: C++

#include <bits/stdc++.h>
#define For(i, begin, end) for(int i=begin;i<end;i++)
#define Rep(i, n) For(i,0,n)
#define Sort(v) sort(v.begin(),v.end())
using namespace std;

vector<int> yakusu(int n){
  vector<int> y0(0);
  int k=1;
  while(k*k<=n){
    if(n%k==0)y0.push_back(k);
    k++;
  }
  vector<int> y=y0;
  for(int i=y0.size()-1;i>=0;i--){
    y.push_back(n/y0[i]);
  }
  return y;
}

int main(){
  int N,M;cin>>N>>M;
  int a=M/N;
  int ans;
  vector<int> y=yakusu(M):
  Rep(i,y.size()){
    if(y[i]<=a)ans=y[i];
  }
  cout<<ans;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: expected ',' or ';' before ':' token
   25 |   vector<int> y=yakusu(M):
      |                          ^
a.cc:26:7: error: 'i' was not declared in this scope
   26 |   Rep(i,y.size()){
      |       ^
a.cc:2:44: note: in definition of macro 'For'
    2 | #define For(i, begin, end) for(int i=begin;i<end;i++)
      |                                            ^
a.cc:26:3: note: in expansion of macro 'Rep'
   26 |   Rep(i,y.size()){
      |   ^~~
Language: Java

import java.util.Scanner;

public class Main4 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int N = in.nextInt(), M = in.nextInt();
        int max = M / N;
        int rst = 1;
        for(int i = max; i >= 1; i--){
            if(M % i == 0){
                rst = i;
                break;
            }
        }
        System.out.println(rst);
    }
}


Compiler output:
Main.java:3: error: class Main4 is public, should be declared in a file named Main4.java
public class Main4 {
       ^
1 error
Language: C++


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))

using namespace std;


int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };


ll m = 1000000007;

const int MOD = 1000000007;

ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}



long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}

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


int main() {
	ll N, M; cin >> N >> M;
	vector<ll>r = enum_div(M);
	ll ans = 0;
	for (auto i : r) {
		if (M >= (ll) i * N) {
			ans = max(ans, (ll)i);
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:96:31: error: conversion from 'vector<int>' to non-scalar type 'vector<long long int>' requested
   96 |         vector<ll>r = enum_div(M);
      |                       ~~~~~~~~^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<algorithm>

#define rep(i, a) for (int i = 0; i < a; i++)
#define reps(i, s, a) for (int i = s; i < a; i++)
#define llint long long int
using namespace std;

const int N_MAX = 505;
const llint INF = 999999999999999;

int main()
{
    int n;
    llint m;
    cin >> n >> m;

    double sq = (int) (sqrt(m));
    vector<llint> div;
 
    reps(i, 1, sq + 1) {
        if (m % i == 0) {
            div.push_back(i);
            div.push_back(m / i);
        }
    }
    int ds = div.size();

    llint max = -1;
    rep(i, ds) {
        if (m / div[i] >= n && div[i] > max) max = div[i];
    }

    cout << max;


    //rep(i, div.size()) cout << div[i] << endl;   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: 'sqrt' was not declared in this scope; did you mean 'sq'?
   24 |     double sq = (int) (sqrt(m));
      |                        ^~~~
      |                        sq
Language: C++

#include <stdio.h>
int main(void){
  int i,j;
  scanf("%d%d",&i,&j);
  for(int cnt=0;cnt<1000000;i++){
    if(j%i==0){
      printf("%d",j/i);
      break;
    }
  }
  if(cnt>100000){
    printf("1");
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |   if(cnt>100000){
      |      ^~~
      |      int
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;
int main() {
	long long int n;
	long long; int m;
	cin >> n;
	cin >> m;
	long long int k = m / n;
	long long int t = 0;
	for (int i = 1; i < k; i++) {
		if (m%k == 0)t = k;
	}
	cout << t;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: declaration does not declare anything [-fpermissive]
    7 |         long long; int m;
      |              ^~~~
Language: C++

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

const int INF = 1e9;

vector<int> divisor(int n) {
  vector<int> v;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      v.push_back(i);
      v.push_back(n / i);
    }
  }
  return v;
}

int n, k;
int main() {
  cin >> n >> k;
  vector<int> v = divisor(k);
  
  int mx = 0;
  for (int a : v) {
    if ((long)n * a <= k) {
      mx = max(mx, a);
    }
  }
  cout << mx << endl;
}


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<int> divisor(int n) {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:23:3: error: 'vector' was not declared in this scope
   23 |   vector<int> v = divisor(k);
      |   ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <set>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:23:10: error: expected primary-expression before 'int'
   23 |   vector<int> v = divisor(k);
      |          ^~~
a.cc:26:16: error: 'v' was not declared in this scope
   26 |   for (int a : v) {
      |                ^
Language: C++

#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <bitset>

const long long LINF = (1e15);
const int INF = (1<<27);
#define EPS 1e-6
const int MOD = 1000000009;

using namespace std;

#define MAX_N 10000
#define MAX_M 100000000

int dp[MAX_M+1][MAX_N+1];

vector<vector<int> > ms;

void pf(int n, int max, int size, vector<int> &a) {
	if (n == 0) {
      if (std::find(a.begin(), a.end(), 1) == a.end() && a.size() == size) {
		    ms.push_back(a);
      }
		return;
	}
	for (int i = min(n, max); i > 0; --i) {
		a.push_back(i);
		pf(n -i, i, size, a);
		a.erase(a.end() - 1);
	}
}

int gcd(int a,int b) {
  if (a%b==0) {
    return b;
  } else {
		return(gcd(b, a%b));
  }
}


int main() {
	vector<int> a;
  int N,  M;
  cin >> N >> M;
	pf(M, M, N, a);
  int max_gcd = -1;
  for (vector<int> m : ms) {
    int g = gcd(m[0], m[1]);
    for (int i = 2; i < m.size(); i++) {
      g = gcd(g, m[i]);
      if (max_gcd > 0 && g < max_gcd)
        break;
    }
    if (g >= max_gcd) {
      max_gcd = g;
    }
	}
  cout << max_gcd << endl;
}


Compiler output:
/tmp/cc0yhuwZ.o: in function `pf(int, int, int, std::vector<int, std::allocator<int> >&)':
a.cc:(.text+0xba): relocation truncated to fit: R_X86_64_PC32 against symbol `ms' defined in .bss section in /tmp/cc0yhuwZ.o
/tmp/cc0yhuwZ.o: in function `main':
a.cc:(.text+0x20f): relocation truncated to fit: R_X86_64_PC32 against symbol `ms' defined in .bss section in /tmp/cc0yhuwZ.o
/tmp/cc0yhuwZ.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x39e): relocation truncated to fit: R_X86_64_PC32 against symbol `ms' defined in .bss section in /tmp/cc0yhuwZ.o
a.cc:(.text+0x3b7): relocation truncated to fit: R_X86_64_PC32 against symbol `ms' defined in .bss section in /tmp/cc0yhuwZ.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include<algorithm>
#include <vector>
#include<string>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define max(x,y) (((x)>(y)) ? x:y)
#define min(x,y) (((x)<(y)) ? x:y)
#define FOR(a,b,c) for(b=(c);b<(a);b++)
#define FOR(a) for(int i=0;i<a;i++)
#define ender {return 0;}
#define tosasuretu(a) (a*(a+1)/2)
inline ll kaizyo(ll);
ll gcd(ll, ll);
ll combination(ll, ll);
int main() {
	ll n, m;
	cin >> n >> m;
	int count = n;
	while (true)
	{
		if (m%count == 0) {
			break;
		}
		count++;
	}
	cout << m / count;
	return 0;
}


inline ll kaizyo(ll x) {
	long ans = 1;
	for (int z = 0; z < x; z++) {
		ans *= (x - z);
	}
	return ans;
}
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a%b);


Compiler output:
a.cc:13:9: warning: "FOR" redefined
   13 | #define FOR(a) for(int i=0;i<a;i++)
      |         ^~~
a.cc:12:9: note: this is the location of the previous definition
   12 | #define FOR(a,b,c) for(b=(c);b<(a);b++)
      |         ^~~
a.cc: In function 'll gcd(ll, ll)':
a.cc:44:28: error: expected '}' at end of input
   44 |         return gcd(b, a%b);
      |                            ^
a.cc:42:20: note: to match this '{'
   42 | ll gcd(ll a, ll b) {
      |                    ^