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

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

signed main(){
	int n,m;cin>>n>>m;
	vector<int>v;

	for(int i=1;i*i<=m;i++){
		if(m%i==0){v.push_back(i);v.push_back(m/i);}
	}
//	sort(begin(v),end(v));
	int x=m/n,ret=1;
	for(auto&& u:v)if(u<=x)ret=max(ret,u); 
	cout<<ret<<endl;
}

Compiler output:
a.cc:3:1: error: 'define' does not name a type
    3 | define int long long
      | ^~~~~~
a.cc:4:29: error: 'i' does not name a type
    4 | define rep(i,n) for(int i=0;i<(n);i++)
      |                             ^
a.cc:4:35: error: 'i' does not name a type
    4 | define rep(i,n) for(int i=0;i<(n);i++)
      |                                   ^
Language: C++

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

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, pair<T1, T2> P)
{
    return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream &operator<<(ostream &s, vector<T> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        if (i > 0)
        {
            s << " ";
        }
        s << P[i];
    }
    return s;
}
template <class T>
ostream &operator<<(ostream &s, vector<vector<T>> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        s << endl
          << P[i];
    }
    return s << endl;
}
template <class T>
ostream &operator<<(ostream &s, set<T> P)
{
    EACH(it, P) { s << "<" << *it << "> "; }
    return s << endl;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, map<T1, T2> P)
{
    EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; }
    return s << endl;
}
typedef long long ll;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> v;
    
    for (int i = 1; i*i <=m ; i++)
    {
        if(m%i==0){
            v.push_back(i);
            if(i==m/i)
                continue;
            v.push_back(m / i);
        }
    }
    sort(v.begin(), v.end());
    int j;
    for (int i = 0; i < v.size(); i++)
    {
        if(v[i]>=m/n){
            j = i;
            break;
        }
    }
   /* */  for (int i = 0; i < v.size(); i++)
    {
        cerr << v[i] << endl;
    }*/

    if(m%n==0){
       // if(v[j]==m/n)
        cout << m/n << endl;
        //else{
          //  cout << v[j - 1] << endl;
        //}
    }
    else{
        cout << v[j-1] << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:98:7: error: expected primary-expression before '/' token
   98 |     }*/
      |       ^
a.cc:100:5: error: expected primary-expression before 'if'
  100 |     if(m%n==0){
      |     ^~
a.cc:107:5: error: 'else' without a previous 'if'
  107 |     else{
      |     ^~~~
Language: C++

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

const int N = 1e5 + 5;
int n,m;

int solve(){
    int d = sqrt(m + 0.5);
    int ans = 0;
    for (int i = d; i >= 1; i--){
        if (k%i == 0) {
            if(i>=n)ans = max(ans,k/i);
            if(k/i>=n)ans = max(ans, i);
        }
    }
    return ans;
}

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n>>m;
    
    cout<<solve(m)<<endl;
    
    
    
}



Compiler output:
a.cc: In function 'int solve()':
a.cc:12:13: error: 'k' was not declared in this scope
   12 |         if (k%i == 0) {
      |             ^
a.cc: In function 'int main()':
a.cc:29:16: error: too many arguments to function 'int solve()'
   29 |     cout<<solve(m)<<endl;
      |           ~~~~~^~~
a.cc:8:5: note: declared here
    8 | int solve(){
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
int main(){int n, m;cin >> n >> m;for(int i = m / n; i > 0; --i)if(m % i == 0){cout<<i<<"\n";return 0;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:21: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    2 | int main(){int n, m;cin >> n >> m;for(int i = m / n; i > 0; --i)if(m % i == 0){cout<<i<<"\n";return 0;}}
      |                     ^~~
      |                     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:2:80: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    2 | int main(){int n, m;cin >> n >> m;for(int i = m / n; i > 0; --i)if(m % i == 0){cout<<i<<"\n";return 0;}}
      |                                                                                ^~~~
      |                                                                                std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<cstdio>

typedef long long int lli;
int main(void) {
    lli n,m,r;
    scanf("%lld%lld",&n,&m);
    if(n==1) printf("%d\n", m), exit(0);
    for(lli i=1; i*n<=m && i*i<=m; i++) {
        if(m % i == 0)
            r = i;
    }
    printf("%lld\n", r);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: 'exit' was not declared in this scope
    7 |     if(n==1) printf("%d\n", m), exit(0);
      |                                 ^~~~
a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include<cstdio>
  +++ |+#include <cstdlib>
    2 |
Language: Java

import java.util.Scanner;
import java.util.TreeSet;

public class D_112_Partition {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		TreeSet<Integer> x = new TreeSet<>();
		for (int i = 1; i <= M/2 + 1; i++) {
			if (M % i == 0) {
				x.add(i);
				x.add(M / i);
			}
		}
		System.out.println(M/x.ceiling(N));
	}
}


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

#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  long long N, M; cin >> N >> M;
  vector<long long> v;
  for(int i = 1; i <= sqrt(M); ++i) {
    if(M % i == 0){
      v.emplace_back(i);
      v.emplace_back(M/i);
    }
  }
  sort(v.begin(); v.end());
  long long ans = 1;
  for(auto itr = v.begin(); itr != v.end(); ++itr) {
    if(*itr <= M/N) ans = *itr;
  }
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:17: error: expected ')' before ';' token
   44 |   sort(v.begin(); v.end());
      |       ~         ^
      |                 )
a.cc:44:26: error: expected ';' before ')' token
   44 |   sort(v.begin(); v.end());
      |                          ^
      |                          ;
a.cc:44:24: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = long long int; _Alloc = std::allocator<long long int>; iterator = std::vector<long long int>::iterator]', declared with attribute 'nodiscard' [-Wunused-result]
   44 |   sort(v.begin(); v.end());
      |                   ~~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:893:7: note: declared here
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;


std::vector<ll> enum_div(ll n);

int main() {

    ll N, M;

    cin >> N >> M;

    vector<ll> v = enum_div(M);

    sort(v.begin(), v.end(), greater<ll>() );

    ll ans = 1;

    for (ll i = 0; i < v.size(); i++) {
        if (v[i] * N <= M) {
            ans = v[i];
            break;
        }
        
    }


    cout << ans << '\n';

}

std::vector<ll> enum_div(ll n)//nの約数を列挙
{
    vector<ll> ret;
    for (ll i = 1; i * i <= n; i++) {

        if (n % i == 0) {

            ret.push_back(i);

            if (i * i != n) {
                ret.push_back(n / i);
            }
        }
    }
    
    return ret;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   18 |     sort(v.begin(), v.end(), greater<ll>() );
      |     ^~~~
      |     sqrt
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int N, M;

    cin >> N >> M;
    // M/N以下のMの最大の約数dじゃね？
    // K=M/dとしたとき、K>=N
    // Kをd個の整数に分けるのはeasyじゃん
    // 間に合うかな

    int MAX=1;
    for (int i=1; i*i <= M; i++){
        if (M % i != 0) continue;
        if (M/i <= M/N) MAX = MAX(M/i, MAX);
        else if (i <= M/N) MAX = max(MAX, i);
    }

    cout << MAX << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:34: error: 'MAX' cannot be used as a function
   17 |         if (M/i <= M/N) MAX = MAX(M/i, MAX);
      |                               ~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  int N, M;
  cin >> N >> M;
  long ans = -1;
  for(int i = 1; i < sqrt(M); i++){
    if(M % i == 0)ans = max(M / i, ans);
  }
  cout << ans << endl;
  return 0;
}

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

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

int main(){
  int N,M; cin>>N>>M;
  int k=M/N;
  while(k){
    if(m%k)
      k--;
    else
      break;
  }
  cout<<k;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'm' was not declared in this scope
    8 |     if(m%k)
      |        ^
Language: C++

/* 【祝】初自力即答 */
#include<iosteram>

typedef std::uint64_t u64;

int main(int argc, const char* argv[]) {
  u64 n, m;
  cin >> n >> m;
  
  for(u64 i = m / n; i > 0; --i) {
    if(m % i == 0) {
      cout << m / i << endl;
    }
  }
  
  cout << 1 << endl;
  
  return 0;
}

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

#include <iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<string>
#include <set>
#include <cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<sstream>
using namespace std;
#define MOD 1000000007
#define ll long long
const long long INF = 1LL << 60;

template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

class UnionFind {
	vector<int> data;
public:
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};


int find(vector<long long> &arr, long long obj) {
	if (arr[arr.size() - 1] < obj)return arr.size()-1;
	if (arr[0] > obj)return -1;

	int min = 0; int max = arr.size() - 1;
	for (int i = 0; i < arr.size(); i++) {
		if (arr[min+(max-min) / 2] > obj) {
			max = min + (max - min) / 2;
		}
		else {
			min = min + (max - min) / 2;
		}
		if (max - min == 1) {
			return min;
		}
	}


}

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

long long dp[110][100010];
int main() {
	ll N, M;
	cin >> N >> M;
	vector<ll> div = divisor(M);
	for (int i = 0; i < div.size(); i++) {
		if (div[i] >= N) {
			return M / div[i];
		}			   
	}


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:92:33: error: conversion from 'vector<long int>' to non-scalar type 'vector<long long int>' requested
   92 |         vector<ll> div = divisor(M);
      |                          ~~~~~~~^~~
a.cc: In function 'int find(std::vector<long long int>&, long long int)':
a.cc:74:1: warning: control reaches end of non-void function [-Wreturn-type]
   74 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  int G = m/n;
  int ans=1;
  for(int i=1;i<=G;i++){
    if(M%i==0){
      ans = i;
    }
  }
  
  cout<<ans<<endl;
  return 0;
}
#include <iostream>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  int G = m/n;
  int ans=1;
  for(int i=1;i<=G;i++){
    if(m%i==0){
      ans = i;
    }
  }
  
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'M' was not declared in this scope
    9 |     if(M%i==0){
      |        ^
a.cc: At global scope:
a.cc:19:5: error: redefinition of 'int main()'
   19 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  int G = m/n;
  int ans=1;
  for(int i=1;i<=G;i++){
    if(M%i==0){
      ans = i;
    }
  }
  
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'M' was not declared in this scope
    9 |     if(M%i==0){
      |        ^
Language: C++

#include<iostream>
using namespace std;

typedef long long ll;

int atcoder(){
    ll n,m;
    cin >> n >> m;
    ll k = m/n;
    
    while(true){
        if(m%k==0) break;
      	k--;
    }
    cout << k << ENT;
    return 0;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    atcoder();
    return 0;
}


Compiler output:
a.cc: In function 'int atcoder()':
a.cc:15:18: error: 'ENT' was not declared in this scope
   15 |     cout << k << ENT;
      |                  ^~~
Language: C++

#include <bits/stdc++.h>
typedef long long int LL;
using namespace std;
#define INF (1e9)
#define LINF (1LL << 60)
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,k,n) for(int i=(k);(i)<(n);(i)++)
#define REP(i,n) for(int i = 0;(i)<(n);(i)++)
#define REPR(i,n) for(int i = n; i >= 0; i--)
#define F first
#define S second
#define MOD 1000000007

int main() {
	int n, m;
	scanf_s("%d %d", &n, &m);
	if (n == 1) {
		printf("%d", m);
		return 0;
	}
	else {
		bool prime = true;
		if (m % 2 == 0) {
			prime = false;
		}
		else {
			int root = sqrt(m);
			for (int i = 3; i <= root; i += 2) {
				if (m % i == 0) {
					prime = false;
					break;
				}
			}
		}
		if (prime) {
			printf("%d", m);
		}
		else {
			for (; m % n != 0; n++);
			printf("%d", m / n);
		}

	}
}


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

#include <bits/stdc++.h>
typedef long long int LL;
using namespace std;
#define INF (1e9)
#define LINF (1LL << 60)
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,k,n) for(int i=(k);(i)<(n);(i)++)
#define REP(i,n) for(int i = 0;(i)<(n);(i)++)
#define REPR(i,n) for(int i = n; i >= 0; i--)
#define F first
#define S second
#define MOD 1000000007

int main() {
	int n, m;
	scanf_s("%d %d", &n, &m);
	if (n == 1) {
		printf("%d", m);
		return 0;
	}
	else {
		bool prime = true;
		int root = sqrt(m);
		if (m % 2 == 0) {
			prime = false;
		}
		else {
			for (int i = 3; i <= root; i += 2) {
				if (m % i == 0) prime = false;
				break;
			}
		}
		if (prime) {
			printf("%d", m);
		}
		else {
			for (; m % n != 0; n++);
			printf("%d", m / n);
		}
	}
}


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

#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
#include<cstring>
#include<sstream>
using namespace std;

typedef long long ll;
vector<int> divisor(int n) {
  vector<int> res;
  for ( int i = 1; i * i <= n; i++ ) {
    if ( n % i == 0 ) {
      res.push_back(i);
      if( i != n / i ) res.push_back(n/i);
    }
  }
  return res;
}
int main() {
  ll N,M; cin >> N >> M;
  vector<ll>data = divisor(M);
  sort(data.begin(),data.end(),greater<int>());
  for ( int i = 0; i < data.size(); i++ ) {
    if ( data[i]*N <= M ) {
      ll tmp = M;
      tmp -= data[i]*(N-1);
      if (  tmp > 0 && tmp % data[i] == 0 ) {
	cout << data[i] << endl;
	return 0;
      }
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:27: error: conversion from 'vector<int>' to non-scalar type 'vector<long long int>' requested
   28 |   vector<ll>data = divisor(M);
      |                    ~~~~~~~^~~
Language: Java

import java.util.Scanner;

public class Abc112d {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long n = scan.nextInt();
		long m = scan.nextInt();
		long ans = 0;
		for (long i=1;i * i <= m;i++) {
			if (m % i != 0)continue;
			long j = m/i;

			if(n * j <= m)ans = Math.max(ans,j);
			if(n * i <= m)ans = Math.max(ans, i);
		}
		System.out.println(ans);
	}

}

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

#include <iostream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <stack>
using namespace std;

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


void main() {
	int N, M;
	int ans = 1;
	cin >> N >> M;


	rep(i, sqrt(M)) {

		if (M % (i + 1) == 0 && (i + 1) >= N) {
			ans = M / (i + 1);
			break;
		}
		else if (M % (i + 1) == 0 && M / (i + 1) >= N) {
			ans = i + 1;
		}


	}



	cout << ans << endl;

	

}

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

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

vector<int> v;

int dfs(int i, int m, int n){
    if (m < n) return 0;
    if (i <= 0) return 1;
    
    int ret = max(dfs(i-1,m,n),dfs(i-1,m/v[i-1],n) * v[i-1]);
    return ret;
}

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

    int a = 2;
    int m = M;
    while (m % a == 0){
        v.push_back(a);
    }

    int a = 3;
    while (m >= a * a) {
        if (m % a == 0) {
            m /= a;
            v.push_back(a);
        } else {
            a = a+2;
        }
    }

    v.push_back(m);

    int ans = dfs(v.size(),M,N);

    cout << ans << endl;

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: redeclaration of 'int a'
   25 |     int a = 3;
      |         ^
a.cc:19:9: note: 'int a' previously declared here
   19 |     int a = 2;
      |         ^
Language: C++

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

using namespace std;

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

    int m = sqrt(M);
    vector<int> a;
    for(int i=1; i<=m; ++i){
        if(M%i==0){
            a.push_back(i);
            a.push_back(M/i);
        }
    }
    sort(a.begin(), a.end());
    for(int i=a.size()-1; i>=0; --i){
        if(M/a[i] >= N){
            cout<<a[i]<<endl;
            return 0;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   19 |     sort(a.begin(), a.end());
      |     ^~~~
      |     sqrt
Language: C++

#include <iostream>
using namespace std;

void main(){
  int N, M;
  int num;
  cin >> N >> M;
  for (int i=M/N; i>0; i--){
    if ((M - N * i) % i == 0){
      num = i
      break;
    }
  cout << num << endl;
  }

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:14: error: expected ';' before 'break'
   10 |       num = i
      |              ^
      |              ;
   11 |       break;
      |       ~~~~~   
a.cc:14:4: error: expected '}' at end of input
   14 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | void main(){
      |            ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=m/n;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:18:10: error: expected '}' at end of input
   18 |         }
      |          ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C

#include<stdio.h>
int main()
{
	int n,m,i;
	scanf("%d%d",n,m);
	for(i=m/n;i>=1;i--)
	{
		if(m%i==0)
		{
			int t=m/i 
			if(t>=n)
			printf("%d\n",t);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:25: error: expected ',' or ';' before 'if'
   11 |                         if(t>=n)
      |                         ^~
Language: C++

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

int main() {
 int n,sum;
  cin >>n>>sum;
  int a=0;
  vector<int> vec(1000000);
  
  if(sum==1){
    cout <<1<<endl;)}
  else{
   for(int i=1;i*i<=sum;i++){
    if(sum%i==0){
      vec.at(a)=i;
        vec.at(a+1)=sum/i;
      a+=2;}
   }
    
    sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());
      
    for(int j=0;j<vec.size();j++){
      if(vec.at(j)<=sum/n){
        cout << vec.at(j)<<endl;
        break;}
    }
      
    
  }
    
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expected primary-expression before ')' token
   11 |     cout <<1<<endl;)}
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n, m;
	cin>>n>>m;
	for(ll i=m/n; i>=1; --i){
		if(m%i==0){
			cout<<i<<'\n';
			return 0;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'll' was not declared in this scope
    8 |         ll n, m;
      |         ^~
a.cc:9:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |         cin>>n>>m;
      |              ^
      |              yn
a.cc:9:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    9 |         cin>>n>>m;
      |                 ^
      |                 tm
a.cc:10:15: error: expected ';' before 'i'
   10 |         for(ll i=m/n; i>=1; --i){
      |               ^~
      |               ;
a.cc:10:23: error: 'i' was not declared in this scope; did you mean 'vi'?
   10 |         for(ll i=m/n; i>=1; --i){
      |                       ^
      |                       vi
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n,m; cin >> n >> m;
  	int ans;
  	for(int i=1;i<100001) if(m % i == 0 && m/i >= n) ans = i;
	cout << ans << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected ';' before ')' token
    7 |         for(int i=1;i<100001) if(m % i == 0 && m/i >= n) ans = i;
      |                             ^
      |                             ;
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
vector <long long int> prime;
 
void eratos()
{
	bool isprime[31624];
	memset(isprime,true,sizeof(isprime));
 
	for(int i=2;i<=31623;i++)
	{
		if(isprime[i])
		{
			prime.push_back(i);
			for(int j=2*i;j<=31623;j+=i)
			{
				isprime[j] = false;
			}
		}
	}
}
 


int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
 
	long long int n,m;
 
	cin >> n >> m;
 
 	eratos();
 
	long long int t = m;
 	long long int res = 1;

	for(int i=prime.size()-1;i>=0;i--)
	{
		if(t==1)
		{
			break;
		}
		if(t%prime[i]==0)
		{
			while(1)
			{
				if(t%prime[i]!=0)
				{
					break;
				}
				if(res*prime[i]*n<=m)
				{
					res*=prime[i];
				}
				t/=prime[i];
			}
		}
	}
 	
 	if(t!=1)
 	{
 		if(t*n<=m)
 		{
 			res = t;
 		}
 	}
 
 	
	if(m%n==0)
	{
		res = res(max,m/n);
	}
 
	for(long long int i=2;i<=sqrt(m);i++)
	{
		if(m%i==0 && i*n<=m)
		{
			long long int x = i;
			while(1)
			{
				if(i*x*n>m || m%(i*x)!=0)
				{
					break;
				}
				x*=i;
			}
			res = max(res,x);
		}
	}
 
	cout << res << '\n';
 
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:26: error: 'res' cannot be used as a function
   75 |                 res = res(max,m/n);
      |                       ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
vector <int> prime;
 
void eratos()
{
	bool isprime[31624];
	memset(isprime,true,sizeof(isprime));
 
	for(int i=2;i<=31623;i++)
	{
		if(isprime[i])
		{
			prime.push_back(i);
			for(int j=2*i;j<=31623;j+=i)
			{
				isprime[j] = false;
			}
		}
	}
}
 
int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
 
	long long int n,m;
 
	cin >> n >> m;
 
	eratos();
 
	if(m%n==0)
	{
		cout << m/n << '\n';
		return 0;
	}
	for(int i=prime.size()-1;i>=0;i--)
	{
		if(m%prime[i]==0 && x*n<=m)
		{
			long long int x = prime[i];
			while(1)
			{
				if(x*n>m)
				{
					break;
				}
				x*=prime[i];
			}
			cout << x << '\n';
			return 0;
		}
	}
	cout << 1 << '\n';
 
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:37: error: 'x' was not declared in this scope
   43 |                 if(m%prime[i]==0 && x*n<=m)
      |                                     ^
a.cc:45:39: error: redeclaration of 'long long int x'
   45 |                         long long int x = prime[i];
      |                                       ^
a.cc:43:37: note: '<typeprefixerror>x' previously declared here
   43 |                 if(m%prime[i]==0 && x*n<=m)
      |                                     ^
Language: C++

#include <iostream>
int main() {
  int64_t n, m;
  std::cin >> n >> m;
  for (int i=m/n; i>=1; --i)
    if (m%i==0) {
      std::cout << i << endl;
      return 0;
    }
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
    ll n, m; cin >> n >> m;
    int ans = -1;
    if(n == 1){
        cout << m << '\n';
        return 0;
    } else {
        for(int i = 1; i*i <= m; i++){
            if(m%i == 0){
                if((ll) i*n <= m){
                    ans = max(ans, i);
                }
                if(i >= n){
                    ans = max(ans, m/i);
                }
            }
        }
    }
    assert(ans != -1);
    cout << n << '\n';
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
    ll n, m; cin >> n >> m;
    if(n == 1){
        cout << m << '\n';
        return 0;
    }
    int ans = -1;
    for(int i = 1; i*i <= m; i++){
        if(m%i == 0){
            if((ll) i*n <= m){
                ans = max(ans, i);
            }
            if(i >= n){
                ans = max(ans, m/i);
            }
        }
    }
    assert(ans != -1);
    cout << n << '\n';
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
    ll n, m; cin >> n >> m;
    if(n == 1){
        cout << m << '\m';
        return 0;
    }
    int ans = -1;
    for(int i = 1; i*i <= m; i++){
        if(m%i == 0){
            if(i*n <= m){
                ans = max(ans, i);
            }
            if(i >= n){
                ans = max(ans, m/i);
            }
        }
    }
    assert(ans != -1);
    cout << n << '\n';
    return 0;
}

Compiler output:
a.cc:13:22: warning: unknown escape sequence: '\m'
   13 |         cout << m << '\m';
      |                      ^~~~
a.cc: In function 'int main()':
a.cc:23:26: error: no matching function for call to 'max(int&, ll)'
   23 |                 ans = max(ans, m/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:23:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   23 |                 ans = max(ans, m/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:23:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |                 ans = max(ans, m/i);
      |                       ~~~^~~~~~~~~~
Language: C++

#include <cmath>
using namespace std;
typedef long long ll;
ll n, m, r;

int main() {
	cin >> n >> m;
	
	ll r = 1;
	for(int i = n; i <= m; i++){
		if(m%i == 0){
			r = m/i;
			break;
		}
	}
	
	cout << r;
	return 0;
}

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

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

int main() {
    int n, m;
    cin >> n >> m;
    double root = sqrt(m);
    int m = 1;
    for (int i = 1; i <= root; i++) {
        if (m % i == 0) {
            if (m / n >= i) {
                m = max(m, i);
            }
            if (m / n >= m / i) {
                m = max(m, m / i);
            }
        }
    }
    cout << m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: redeclaration of 'int m'
   10 |     int m = 1;
      |         ^
a.cc:7:12: note: 'int m' previously declared here
    7 |     int n, m;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#typedef ll long long;
int main() {
	ll N, M;
	cin >> N >> M;
	ll ans = 0;
	for (int i = 1; i*i <= M; i++) {
		if (M%i == 0) {
			ll b = M / i;
			if (b >= N) {
				ans = i;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #typedef
    3 | #typedef ll long long;
      |  ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
    5 |         ll N, M;
      |         ^~
a.cc:6:16: error: 'N' was not declared in this scope
    6 |         cin >> N >> M;
      |                ^
a.cc:6:21: error: 'M' was not declared in this scope
    6 |         cin >> N >> M;
      |                     ^
a.cc:7:11: error: expected ';' before 'ans'
    7 |         ll ans = 0;
      |           ^~~~
      |           ;
a.cc:10:27: error: expected ';' before 'b'
   10 |                         ll b = M / i;
      |                           ^~
      |                           ;
a.cc:11:29: error: 'b' was not declared in this scope
   11 |                         if (b >= N) {
      |                             ^
a.cc:12:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |                                 ans = i;
      |                                 ^~~
      |                                 abs
a.cc:16:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long;
int main() {
	ll N, M;
	cin >> N >> M;
	ll ans = 0;
	for (int i = 1; i*i <= M; i++) {
		if (M%i == 0) {
			ll b = M / i;
			if (b >= N) {
				ans = i;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:5:9: note: in expansion of macro 'll'
    5 |         ll N, M;
      |         ^~
a.cc:5:12: error: 'N' was not declared in this scope
    5 |         ll N, M;
      |            ^
a.cc:5:15: error: 'M' was not declared in this scope
    5 |         ll N, M;
      |               ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:7:9: note: in expansion of macro 'll'
    7 |         ll ans = 0;
      |         ^~
a.cc:7:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |         ll ans = 0;
      |            ^~~
      |            abs
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:10:25: note: in expansion of macro 'll'
   10 |                         ll b = M / i;
      |                         ^~
a.cc:10:28: error: 'b' was not declared in this scope
   10 |                         ll b = M / i;
      |                            ^
Language: C++

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

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

    if(N == 1) {
        cout << M << endl;
        return 0;
    }
    int D = min(M / N, (int)sqrt(double(M));
    for(; D>1; --D) {
        if(M % D == 0) {
            cout << D << endl;
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:44: error: expected ')' before ';' token
   13 |     int D = min(M / N, (int)sqrt(double(M));
      |                ~                           ^
      |                                            )
Language: C++

#define typeof(x) __typeof__(x)
#define int long long int
#define double long double
#define mod(x) ((x % MOD) + MOD) % MOD
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);--i)

#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SZ(c) (int)((c).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define LB(c,x) (int)(lower_bound(ALL(c),x)-(c).begin())
#define UB(c,x) (int)(upper_bound(ALL(c),x)-(c).begin())
#define COUNT(c,x) UB(c,x)-LB(c,x)
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (s).find(e)!=(s).end()
#define PB push_back
#define MP make_pair
#define vec vector

#define dump(x)  cerr << #x << " = " << (x) << endl;

using namespace std;

typedef pair<int,int> P;
struct edge { int to, cost; };

const int INF = 1e18;
const int MOD = 1e9+7;

template<typename T> ostream& operator << (ostream& s, const vector<T>& v) {
   s << "[";
   for (int i = 0; i < v.size(); i++) { s << v[i]; if (i < v.size() - 1) s << " "; }
   s << "]";
   return s;
}
template<typename T1, typename T2> ostream& operator << (ostream& s, const pair<T1,T2>& p) {
   s << "(" << p.first << "," << p.second << ")";
   return s;
}

signed main()
{
   int N, M; cin >> N >> M;
   int ans;
   for (int i = 1; i <= M/N && i*i <= M; i++) {
      if (M % i == 0) {
         ans = i;
      }
   }

   cout << ans << endl;

   return 0;
}


Compiler output:
a.cc:28:9: error: 'pair' does not name a type
   28 | typedef pair<int,int> P;
      |         ^~~~
a.cc:34:22: error: 'ostream' does not name a type
   34 | template<typename T> ostream& operator << (ostream& s, const vector<T>& v) {
      |                      ^~~~~~~
a.cc:40:36: error: 'ostream' does not name a type
   40 | template<typename T1, typename T2> ostream& operator << (ostream& s, const pair<T1,T2>& p) {
      |                                    ^~~~~~~
a.cc: In function 'int main()':
a.cc:47:14: error: 'cin' was not declared in this scope
   47 |    int N, M; 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 | #define typeof(x) __typeof__(x)
a.cc:55:4: error: 'cout' was not declared in this scope
   55 |    cout << ans << endl;
      |    ^~~~
a.cc:55:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:55:19: error: 'endl' was not declared in this scope
   55 |    cout << ans << endl;
      |                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define typeof(x) __typeof__(x)
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define con continue
#define bk break
#define LL long long
#define db double
#define pt cout<<'\n';
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
LL inf=2147483647;const long long ll =9223372036854775807,ninf=1000000000;const double eps = 1e-6; const long long nll =1000000000000000000;
#define sz size()
#define len(X) strlen(X)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ULL unsigned long long
#define de cout<<"test"<<endl;
#define st system("pause");
#define F first
#define S second
int main()
{
LL a,b;
while(cin>>a>>b){
    
    
    
    LL ans=1;
    set<LL>num;
    for(int i=2;i<=sqrt(b);i++){
        if(b%i==0){
            num.insert(i);
            num.insert(b/i);
        }
    }
    for(set<LL>::iterator i=num.begin();i!=num.end();i++){
        if(*i*a<=b){
            ans=i;
        }
    }
    cout<<ans<<endl;
    
    
    
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:17: error: cannot convert 'std::set<long long int>::iterator' {aka 'std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, std::less<long long int>, std::allocator<long long int> >::const_iterator'} to 'long long int' in assignment
   36 |             ans=i;
      |                 ^
      |                 |
      |                 std::set<long long int>::iterator {aka std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, std::less<long long int>, std::allocator<long long int> >::const_iterator}