Language: C++

.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}

bool notP[10005];

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

    if(N*2 >M){
        cout << 1 << endl;
        return 0;
    }


    rep(i, 10001)rep(j,10001){
        if(i == 0) continue;
        if(i == 1) continue;
        if(j == 0) continue;
        if(j == 1) continue;
        if(i*j>10001) break;

        notP[i*j] = true;
    }
    vector<ll> prime;
    rep(i, 10005){
        if(i == 0) continue;
        if(i == 1) continue;
        if(!notP[i]) prime.pb(i);
    }

    ll ans = 1;
    rep(i, prime.size()){
        if((M%prime[i]==0) && (M/prime[i] > N)){
            ll A = M/prime[i]/N;
            ans = max(ans, gcd(A * prime[i], (A+1LL)*prime[i]));
        }
    }

    cout << ans << endl;

    return 0;
}

/*
/^[\w!\x22\#$%&@\'() * +,-.\/;:]+$/
*/


Compiler output:
a.cc:1:1: error: expected unqualified-id before '.' token
    1 | .rbegin(),a.rend()
      | ^
a.cc:7:1: error: 'll' does not name a type
    7 | ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
      | ^~
a.cc:8:1: error: 'll' does not name a type
    8 | ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
      | ^~
a.cc: In function 'int main()':
a.cc:14:5: error: 'll' was not declared in this scope
   14 |     ll N , M ;
      |     ^~
a.cc:15:5: error: 'cin' was not declared in this scope
   15 |     cin >> N >> M ;
      |     ^~~
a.cc:15:12: error: 'N' was not declared in this scope
   15 |     cin >> N >> M ;
      |            ^
a.cc:15:17: error: 'M' was not declared in this scope
   15 |     cin >> N >> M ;
      |                 ^
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << 1 << endl;
      |         ^~~~
a.cc:18:22: error: 'endl' was not declared in this scope
   18 |         cout << 1 << endl;
      |                      ^~~~
a.cc:23:9: error: 'i' was not declared in this scope
   23 |     rep(i, 10001)rep(j,10001){
      |         ^
a.cc:23:5: error: 'rep' was not declared in this scope
   23 |     rep(i, 10001)rep(j,10001){
      |     ^~~
a.cc:32:5: error: 'vector' was not declared in this scope; did you mean 'rmvector'?
   32 |     vector<ll> prime;
      |     ^~~~~~
      |     rmvector
a.cc:32:16: error: 'prime' was not declared in this scope
   32 |     vector<ll> prime;
      |                ^~~~~
a.cc:39:7: error: expected ';' before 'ans'
   39 |     ll ans = 1;
      |       ^~~~
      |       ;
a.cc:47:5: error: 'cout' was not declared in this scope
   47 |     cout << ans << endl;
      |     ^~~~
a.cc:47:13: error: 'ans' was not declared in this scope
   47 |     cout << ans << endl;
      |             ^~~
a.cc:47:20: error: 'endl' was not declared in this scope
   47 |     cout << ans << endl;
      |                    ^~~~