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

2 9import java.util.*;

public class Main {
    static int border;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        
        border = m / n;
        
        List<Long> list = divisorList(m);
        
        for (int i = list.size() - 1; i >= 0; i--) {
            System.out.println(list.get(i));
            return;
        }
    }
    
    public static List<Long> divisorList(long n) {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                if (border >= i) {
                res.add(i);
                }
                long j = n / i;
                if (j != i) {
                    if (border >= j) {
                    res.add(j);
                    }
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
2 9import java.util.*;
^
1 error
Language: Java

5 22import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        int n = sc.nextInt();
        long tmp1 = n/m;
        long tmp2 = n%m;
        System.out.println(gcd(tmp1, tmp2));
    }
    
    public static long lcm(long m, long n) {
        return m * (n / gcd(m, n));
    }
    
    public static long gcd(long a, long b) {
        if (b == 0) return a;
        
        return gcd(b, a % b);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
5 22import java.util.*;
^
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: invalid operands of types 'double' and 'long long int' to binary 'operator%'
   10 |         if(i <= M/N && M%i == 0){
      |                        ~^~
      |                        | |
      |                        | long long int
      |                        double
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
int64_t MOD=10000007;

int main() {
  int N,M;
  cin>>N>>M;
  for(int i=M;i>0;i--){
    if(i*N>M||M%i!=0) continue;
    cout<< i;
    break;
    
    
}


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

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
int64_t MOD=10000007;

int main() {
  int N,M;
  cin>>N>>M;
  int T=M*(M+1)/2;
  for(int i=N;i>0;i--){
    if(i*T>N||N%i!=0) continue;
    cout<< i;
    break;
    
    
}


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

#include <bits/stdc++.h>

using namespace std;

int main(){

	int n, m, lp, les;
	cin>> n >> m;

  	lp=(m+n-1)/n;
  	cout<< lp <<endl;//
  
  	for(int i=lp;i>0;i--){
      les=m-n*i);
      cout<< i << " " << les <<endl;//
      if(les%i==0){
        cout<< i <<endl;
        return 0;
      }
    }
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: expected ';' before ')' token
   14 |       les=m-n*i);
      |                ^
      |                ;
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdint>
#include <sstream>
#include <map>
#include<vector>

using namespace std;
typedef long long ll;

bool isPrime(ll n){ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true;
    if (n % 2 == 0 || n % 3 == 0) 
        return false;  
    for (ll i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
    return true; 
} 

ll ans,mx,sum,mn=1e18,cnt;
ll flag;

int main(){
	ll n,m;
	cin>>n>>m;
	for(ll i=1; i<=1000000; i++){
		ll flag=i*n;
		if(flag <=m){
			ll temp=m-flag;
			if(temp%i==0) {
				mx=max(mx,i);
			}
		}
	}
	if(n==1 ) cout<<m;
	else if(check(m)==1) cout<<1<<endl;
	else cout<<mx<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: 'check' was not declared in this scope
   42 |         else if(check(m)==1) cout<<1<<endl;
      |                 ^~~~~
Language: C++

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

int main() {
	long long N, M;
	cin >> N >> M;
	vector<int> Yakusu;
	for (int i = 1; i <= (int)sqrt(M) + 1; i++) if (M % i == 0) Yakusu.push_back(i);
	sort(Yakusu.begin(), Yakusu.end(), greater<int>());
	for (int y : Yakusu) {
		if (y * N > M) continue;
		cout << y << endl;
		return 0;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: 'sqrt' was not declared in this scope
   10 |         for (int i = 1; i <= (int)sqrt(M) + 1; i++) if (M % i == 0) Yakusu.push_back(i);
      |                                   ^~~~
Language: C++

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


vector<long long> calc_divisor(long long n) {
    vector<long long> res;
    for (long long i=1ll; i*i<=n; i++) {
        if (n % i == 0) {
            res.push_back(i);
            long long j = n / i;
            if (j != i) res.push_back(j);
        }
    }
    sort(res.begin(), res.end());
    return res;
}


int main() {
    long long n, m;
    cin >> n >> m;
    vector<long long> div = calc_divisor(M);

    long long res = 1;
    for(auto d : div){
        if (d * n <= m){
            res = max(res, d);
        }
    }

    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:42: error: 'M' was not declared in this scope
   22 |     vector<long long> div = calc_divisor(M);
      |                                          ^
Language: C++

#include<iostream>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define print(i) std::cout << (i) << '\n'
#define ll long long
int main(){
ll a,s;cin>>a>>s;ll ub=max((ll)sqrt(s),a),lb=a+s-ub;
for(ll y=lb;y!=ub+1;y++){if (s%y==0){print(s/y);return 0;}}
print(1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: 'sqrt' was not declared in this scope
    7 | ll a,s;cin>>a>>s;ll ub=max((ll)sqrt(s),a),lb=a+s-ub;
      |                                ^~~~
a.cc:8:10: error: 'lb' was not declared in this scope; did you mean 'ub'?
    8 | for(ll y=lb;y!=ub+1;y++){if (s%y==0){print(s/y);return 0;}}
      |          ^~
      |          ub
Language: C++

#include<iostream>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define print(i) std::cout << (i) << '\n'
#define ll long long
int main(){
ll a,s;cin>>a>>s;
for(int y=a;y!==s+1;y++){if (s%y==0){print(s/y);break;}}

}
#include<iostream>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define print(i) std::cout << (i) << '\n'
#define ll long long
int main(){
ll a,s;cin>>a>>s;
for(int y=a;y!==s+1;y++){if (s%y==0){print(s/y);break;}}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected primary-expression before '=' token
    8 | for(int y=a;y!==s+1;y++){if (s%y==0){print(s/y);break;}}
      |                ^
a.cc: At global scope:
a.cc:16:5: error: redefinition of 'int main()'
   16 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:18:16: error: expected primary-expression before '=' token
   18 | for(int y=a;y!==s+1;y++){if (s%y==0){print(s/y);break;}}
      |                ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()
// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class X> void DEBUG(X d, T e){if(DEBUG_OUT == false)return;std::cout <<d<<" ";DEBUG(e);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }


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);
}
void solve(void)
{
  int N,M;
  cin>>N>>M;
  vector<int> PRIME = divisor(M);
  int ANS = 1;
  for (int i = 0; i < PRIME.size(); i++)
  {
    if(M/PRIME[i]>=N)
    {
      ANS = max(ANS,PRIME[i]);
    }
  }
  
  cout<<ANS<<endl;
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:63:30: error: conversion from 'vector<long int>' to non-scalar type 'vector<long long int>' requested
   63 |   vector<int> PRIME = divisor(M);
      |                       ~~~~~~~^~~
Language: C++

int main(){
  int N,M;
  cin>>N>>M;
  for(int i=1;i<=M;i++){
    int ans=1;
    if(M%i==0&&i>=N){
      cout<<max(M/i,ans)<<endl;
      break;
    }else if(M%i==0&&M/i>=N){
      ans=i;
    }
  }
}


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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
using namespace std;
typedef long long ll;
typedef long double ld;

int main(){
    ll n,m;cin>>n>>m;
    vector<ll> d;
    for(ll i=1;i*i<=m;i++){
        if(m%i==0){d.push_back(i);d.push_back(m/i);
    }
    sort(d.begin(),d.end());
    ll ans=0;
    for(int i=0;i<d.size();i++){
        ll yay=d[i];
        if(yay*n<=m)ans=yay;
    }
    cout<<ans;
    
    
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
using namespace std;
typedef long long ll;

int main(){
    ll n,m;cin>>n>>m;
    ll ans=0;
    for(ll i=min(m/n,sqrt(m));i>=1;i--){
        if(m%i==0){
            ll a=m/i;
            if(a>=n){ans=max(ans,i);break;}
        }
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: no matching function for call to 'min(ll, __gnu_cxx::__enable_if<true, double>::__type)'
   14 |     for(ll i=min(m/n,sqrt(m));i>=1;i--){
      |              ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:14:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
   14 |     for(ll i=min(m/n,sqrt(m));i>=1;i--){
      |              ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:14:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   14 |     for(ll i=min(m/n,sqrt(m));i>=1;i--){
      |              ~~~^~~~~~~~~~~~~
Language: C++

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

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#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)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)

int N,M;

int main(){
	fast;
	cin>>N>>M;
	
	int ans = -1;
	FOR(i,2,sqrt(M)+1){
		if (M % i == 0){
			if (M/i <= N) ans = max(ans,int(M/i));
			if (i <= N) ans = max(ans,int(i));
		}
	}
	
	cout<<ans;
	
}



Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | p#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'p' does not name a type
    1 | p#include <bits/stdc++.h>
      | ^
a.cc:5:9: error: 'pair' does not name a type
    5 | typedef pair<ll,ll> pi;
      |         ^~~~
a.cc:6:9: error: 'vector' does not name a type
    6 | typedef vector <ll> vi;
      |         ^~~~~~
a.cc:7:9: error: 'vector' does not name a type
    7 | typedef vector <pi> vpi;
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:18:14: error: 'ios_base' has not been declared
   18 | #define fast ios_base::sync_with_stdio(false),cin.tie(0)
      |              ^~~~~~~~
a.cc:23:9: note: in expansion of macro 'fast'
   23 |         fast;
      |         ^~~~
a.cc:18:47: error: 'cin' was not declared in this scope
   18 | #define fast ios_base::sync_with_stdio(false),cin.tie(0)
      |                                               ^~~
a.cc:23:9: note: in expansion of macro 'fast'
   23 |         fast;
      |         ^~~~
a.cc:27:17: error: 'sqrt' was not declared in this scope
   27 |         FOR(i,2,sqrt(M)+1){
      |                 ^~~~
a.cc:10:37: note: in definition of macro 'FOR'
   10 | #define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
      |                                     ^
a.cc:29:45: error: 'max' was not declared in this scope
   29 |                         if (M/i <= N) ans = max(ans,int(M/i));
      |                                             ^~~
a.cc:30:43: error: 'max' was not declared in this scope
   30 |                         if (i <= N) ans = max(ans,int(i));
      |                                           ^~~
a.cc:34:9: error: 'cout' was not declared in this scope
   34 |         cout<<ans;
      |         ^~~~
Language: C++


#pragma GCC optimize ("O3")

#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

using namespace std;

typedef long long ll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "{";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "}";

    return os;
}

ll pow_mod(ll a, ll p) {
    ll res = 1;
    while(p) {
        if (p & 1) res = (res * a) % MOD;
        a = (a * a) % MOD;
        p >>= 1;
    }

    return res;
}


ll mod_inv(ll a, ll m) {
    ll b = m, u = 0, v = 1;
    while(a) {
        ll t = b / a;
        swap(b -= t * a, a);
        swap(u -= t * v, v);
    }

    return (u % m + m) % m;
}

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

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}


map<ll, int> get_primes(ll m, ll M) {
    map<ll, int> p;
    p[1] = 1;
    int s[m];
    REP(i, m) s[i] = i;
    for(int i = 2; i <= m; ++i) {
        if (s[i] != i) continue;

        for(int j=i+i; j <= m; j += i) {
            s[j] = i;
        }

        int cnt = 0;
        while(M % i == 0) {
            M /= i;
            ++cnt;
        }
        if (cnt > 0) p[i] = cnt;
    }
    if (M != 1) p[M] = 1;

    return p;
}


#ifdef LOCAL
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83
#endif


int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    int N; ll M;
    cin >> N >> M;

    int m = int(floor(sqrt(M))) + 1;
    map<ll, int> p = get_primes(m, M);

    int n = N + 1;
    bool c[n][2];
    REP(i, n) {
        c[i][0] = false;
        c[i][1] = false;
    }
    c[1][0] = true;

    ll mm = inf;
    int b = 0;
//    for (auto it = p.begin(); it != p.end(); ++it) debug(it->fi, it->se)
    for (auto it = p.begin(); it != p.end(); ++it) {
        REP(i, it->se) {
            REP(i, n) {
                if (c[i][b]) {
                    ll t = i * it->fi;
                    if(t < N) {
                        c[i][b^1] = true;
                        c[t][b^1] = true;
                    } else {
                        debug(t)
                        mm = min(mm, t);
                    }
                }
            }
            b ^= 1;
        }
    }
    
    cout << fixed << setprecision(20);
    cout << int(M / mm) << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:137:25: error: expected ';' before 'mm'
  137 |                         mm = min(mm, t);
      |                         ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; i<(n); ++(i))
#define print(a) cout << (a) << endl

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected primary-expression before '<' token
   16 |       if(i=<m/n) ans=max(ans,i);
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; i<(n); ++(i))
#define print(a) cout << (a) << endl

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected primary-expression before '<' token
   16 |       if(i=<m/n) ans=max(ans,i);
      |            ^
a.cc:17:23: error: no matching function for call to 'max(long long int)'
   17 |       if(i>=n) ans=max(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:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
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:   template argument deduction/substitution failed:
a.cc:17:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   17 |       if(i>=n) ans=max(m/i);
      |                    ~~~^~~~~
/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:   candidate expects 2 arguments, 1 provided
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 d = M/N;
   int ans =0;
   for(int i=Math.sqrt(M);i>=1;i++)
   {
     if(M%i==0&&i<=d)
     {
       ans =i;
       break;
     }
   }
   System.out.println(ans);   
 }
}

Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from double to int
   for(int i=Math.sqrt(M);i>=1;i++)
                      ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected ';' before 'return'
    7 |       cout << m/i
      |                  ^
      |                  ;
    8 |       return 0;
      |       ~~~~~~      
a.cc:11:12: error: expected ';' before '}' token
   11 |   cout << 1
      |            ^
      |            ;
   12 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long n, m;

int main() {
    cin >> n >> m;
    long long limit = m / n;
    for(long long i = limit; i >= 1; --i) {
        if(m % i == 0) {
            cout << i << endl;
            return 0;
        }
}

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

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

typedef long long int ll;

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

    cout << ans;

    return 0;
}

Compiler output:
a.cc:15:33: error: extended character 　 is not valid in an identifier
   15 |                 ans = max(m / i,　ans);
      |                                 ^
a.cc: In function 'int main()':
a.cc:15:33: error: '\U00003000ans' was not declared in this scope
   15 |                 ans = max(m / i,　ans);
      |                                 ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;

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

    }
    
    cout << ans << endl;


}


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

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;

const int MOD = 1000000007;

vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long 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);
}


int main() {
    int N, M;
    cin >> N >> M;
    vector<long long> divs = divisor(M);
    ll ans = 1;
    for (auto d: divs) {
        if (d * N <= M) chmax(ans, d);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'll' was not declared in this scope
   27 |     ll ans = 1;
      |     ^~
a.cc:29:31: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |         if (d * N <= M) chmax(ans, d);
      |                               ^~~
a.cc:4:21: note: in definition of macro 'chmax'
    4 | #define chmax(x, y) x = max(x, y)
      |                     ^
a.cc:31:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <bits/stdc++.h>
#define ALL(A) (A).begin(),(A).end()
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)

const ll mod = 1e9+7;
const ll INF = -1*((1LL<<63)+1);
const int inf = -1*((1<<31)+1);

using namespace std;

int gcd(int a,int b){
	int c;
	while(a%b){
		c = b;
		b = a%b;
		a = c;
	}
	return b;
}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N,M;
	cin >> N >> M;
	int x = M/N;
	if(M%N == 0)cout << x << endl;
	else {
		int ans = 1;
		int lest;
		for(int i=1;i<=M/N;i++){
			int sum = i*(N-1);
			last = M - sum;
			if(last==0)continue;
			ans = max(ans,gcd(i,last));
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: 'last' was not declared in this scope; did you mean 'lest'?
   33 |                         last = M - sum;
      |                         ^~~~
      |                         lest
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected ',' or ';' before 'if'
    6 |   if(N==1){
      |   ^~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int N,M,a=1;
    cin>>N>>M;
    for(int i=1;i*i<=M&&i<=M/N;i++){
        if(M%i==0){
            a=max(a,i);
             if(M/i<=M/N){
                a=max(a,M/i);
        }
    }
    cout<<a<<endl;
}

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

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
	using namespace std;
	typedef long long ll;
	ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
	ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

	int main() {
		long long n, m;
		long long res = m % n;
		if (res == 0)cout << res << endl;
		else {
			long long loop = m / n;
			for (int i = 1;i <= loop;++i) {
				long long ans = 1;
				long long target = m - i * (n - 1);
				if (target % i == 0)ans = i;
			}
			cout << ans << endl;
		}
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |                         cout << ans << endl;
      |                                 ^~~
      |                                 abs
Language: C++

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


Compiler output:
a.cc:4:13: error: extended character ¥ is not valid in an identifier
    4 | #define int ll¥
      |             ^
a.cc: In function 'int main()':
a.cc:4:13: error: 'll\U000000a5' was not declared in this scope; did you mean 'll'?
    4 | #define int ll¥
      |             ^~~
a.cc:6:5: note: in expansion of macro 'int'
    6 |     int N,M; cin >> N >> M;
      |     ^~~
a.cc:6:21: error: 'N' was not declared in this scope
    6 |     int N,M; cin >> N >> M;
      |                     ^
a.cc:6:26: error: 'M' was not declared in this scope
    6 |     int N,M; cin >> N >> M;
      |                          ^
a.cc:7:9: error: expected ';' before 'ans'
    7 |     int ans = 0;
      |         ^~~
a.cc:8:13: error: expected ';' before 'i'
    8 |     for(int i = 1; i * i <= M; ++i){
      |             ^
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for(int i = 1; i * i <= M; ++i){
      |                    ^
a.cc:11:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |             ans = max(i,M / i);
      |             ^~~
      |             abs
a.cc:14:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) reps(i,0,n)
#define reps(i,m,n) for(int i=(m);i<(n);i++)
int main(){
  int n,m;
  cin>>n>>m;
  vector<int> a;
  reps(i,1,sqrt(m)+1){
    if(m%i==0){
      a.push_back(i);
      if(i*i!=m)a.push_back(m/i);
    }
  }
  sort(all(a),greater<int>());
  for(auto au:a){
    if(au*n<=m){
      cout<<au;return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   19 |   sort(all(a),greater<int>());
      |        ^~~
      |        std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define sortr(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define MAX 2000001
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

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(ret);
  return (ret);
}

int main() {
    int n,m;
    cin>>n>>m;
    vector<ll> a=divisor(m);
    for(int i=a.size()-1;i>=0;i--){
        if(a[i]*n<=m){
            cout<<a[i]<<endl;
            return 0;
        }
    }
    return 0;
}










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

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m,t,res;
    cin>>n>>m;
    res=1
    for(int i = 1;i*i<=m&&i<=m/n;i++){
        if(m%i==0){
            res = i;
        }
    }
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected ';' before 'for'
    6 |     res=1
      |          ^
      |          ;
    7 |     for(int i = 1;i*i<=m&&i<=m/n;i++){
      |     ~~~   
a.cc:7:19: error: 'i' was not declared in this scope
    7 |     for(int i = 1;i*i<=m&&i<=m/n;i++){
      |                   ^
Language: C++

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

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~
Language: C++

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

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~                 
a.cc: In function 'int main()':
a.cc:12:4: error: expected '}' at end of input
   12 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
int main(){
  int n, m;
  cin >> n >> m;
  int ans;
  for(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:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> n >> m;
      |   ^~~
      |   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:8:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |       cout << m/i << endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |       cout << m/i << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:4: error: expected '}' at end of input
   11 |   }
      |    ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<iostream>

using namespace std;

int main(){
  int N,M;cin>>N>>M;
  int ans=N==1?M:1;
  for(int i=0;i<=M/2;i++){
    if(!M%i and i*N<=M and ans<i) ans=i
  }
  cout<<ans<<endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:40: error: expected ';' before '}' token
    9 |     if(!M%i and i*N<=M and ans<i) ans=i
      |                                        ^
      |                                        ;
   10 |   }
      |   ~                                     
a.cc:11:18: error: expected ';' before '}' token
   11 |   cout<<ans<<endl
      |                  ^
      |                  ;
   12 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1e9+1;

/*
mの約数で、m/x>=nを満たす最大のx
*/

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


void solve(){
    int n, m;
    cin >> n >> m;
    //int thres = ceil(sqrt(m));
    int thres = m;
    int ans;
    vector<int> v = enum_div(m);
    //if(n==1) ans = m;
    int s = v.size();
    /*
    for(int i=s-1; i>=0; i--){
        int x=v[i];
        if(m/x>=n){
            ans = x;
            break;
        }
    }
    */
    for(int i=n; i<=m/2+!; i++){
        if(m%i==0){
            ans = m/i;
            break;
        }
    }
    cout << ans << endl;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:49:26: error: expected primary-expression before ';' token
   49 |     for(int i=n; i<=m/2+!; i++){
      |                          ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: no matching function for call to 'min(int, __gnu_cxx::__enable_if<true, double>::__type)'
    8 |   int x = min(m / n, sqrt(m)), 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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:8:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
    8 |   int x = min(m / n, sqrt(m)), ans;
      |           ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:8:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    8 |   int x = min(m / n, sqrt(m)), ans;
      |           ~~~^~~~~~~~~~~~~~~~
a.cc:10:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     if(m % i == 0) ans = i;
      |                    ^~~
      |                    abs
a.cc:13:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   if(n == 1) ans = m;
      |              ^~~
      |              abs
a.cc:15:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define mod 1000000007
typedef long long int ll;
int u(const void *a, const void *b){
    return *(ll*)a-*(ll*)b;
}
int d(const void *a, const void *b){
    return *(ll*)b-*(ll*)a;
}
int z(int a){
  if(a<1)a*=-1;
  return a;
}
int min(int a,int b){
  if(a>b)return b;
  return a;
}
int max(int a,int b){
  if(a>b)return a;
  return b;
}
int gcd(int a,int b){
  if(!b)return a;
  return gcd(b,a%b);
}
int main(void){
  ll n,m,ans=1;
  scanf("%lld %lld",&n,&m);
  for(ll i=2;i<=n;i++)if(m%i<1&&double(m/i)>=n)ans=max(ans,i);
  PRL(ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:39:33: error: expected expression before 'double'
   39 |   for(ll i=2;i<=n;i++)if(m%i<1&&double(m/i)>=n)ans=max(ans,i);
      |                                 ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdint>

using namespace std;

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

int main() {
  int N, M;
  cin >> N >> M;
  int maxv = INT_MIN;
  for (auto x : divisors(M)) {
    if (x >= N) {
      maxv = max(M/x, maxv);
    }
  }
  cout << maxv << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: 'INT_MIN' was not declared in this scope
   27 |   int maxv = INT_MIN;
      |              ^~~~~~~
a.cc:10:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <cstdint>
  +++ |+#include <climits>
   10 |
Language: C++

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

using namespace std;

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

int main() {
  int N, M;
  cin >> N >> M;
  int maxv = INT_MIN;
  for (auto x : divisors(M)) {
    if (x >= N) {
      maxv = max(M/x, maxv);
    }
  }
  cout << maxv << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'INT_MIN' was not declared in this scope
   26 |   int maxv = INT_MIN;
      |              ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <cmath>
  +++ |+#include <climits>
    9 |
Language: C++

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

vector<ll> divisor(ll n){
	vector<ll> ret;
	for(int i=1;i*i<=n;i++){
		if(n%i==0){
			ret.push_back(i);
			if(i*i!=n)ret.push_back(n/i);
		}
	}
	sort(ret.begin(),ret.end());
	return(ret);
}
 
int main(){
	ll n,m; cin >> n >> m;
	vector<ll> v=divisor(m);
	reverse(v.begin(),v.end());
	for(int i=0;i<v.size();i++){
		ll p=v[i];
		if(p*n<=m){
			cout << p << endl;
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'std::vector<long long int> divisor(ll)':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |         sort(ret.begin(),ret.end());
      |         ^~~~
      |         short
a.cc: In function 'int main()':
a.cc:21:9: error: 'reverse' was not declared in this scope
   21 |         reverse(v.begin(),v.end());
      |         ^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |         cin>>n>>m;
      |         ^~~
      |         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:7:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |                         cout<<i;
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~