stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define MAX 300000

vector<int>g[MAX];

int dfs(int u,int p){

    int l=0;

    for(int v:g[u]){

        if(v!=p){

         l^=1+dfs(v,u);   

        }

    }

    return l;

}

int main() {

	int n,u,v;

	cin>>n;

	for(int i=0;i<n-1;i++){

	    cin>>u>>v;

	    g[u].push_back(v);

	    g[v].push_back(u);

	}

	cout<<(dfs(1,0)?"Alice":"Bob");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.672664291464868x):
#include<bits/stdc++.h>

#define mxn 100005

using namespace std;

vector<int>adj[mxn];

int dfs(int x, int p)

{

    int xr= 0;

    for(int i=0; i<adj[x].size(); i++)

    {

        int y= adj[x][i];

        if(y!=p)xr^= (1+dfs(y, x));

    }

    return xr;

}

int main()

{

    int n;

    scanf("%d", &n);

    for(int i=1; i<n; i++)

    {

        int x, y;

        scanf("%d %d", &x, &y);

        adj[x].push_back(y);

        adj[y].push_back(x);

    }

    if(dfs(1, 1))puts("Alice");

    else puts("Bob");

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int maxn=200100;



vector<int>v[maxn];

int n;



int dfs(int x,int fa)

{

	int ans=0;

	for(int i=0;i<v[x].size();i++)

	{

		int y=v[x][i];

		if(y==fa)continue;

		ans^=(dfs(y,x)+1);

	}

	return ans;

}



int main()

{

	cin>>n;

	for(int i=1;i<n;i++)

	{

		int x,y;

		cin>>x>>y;

		v[x].push_back(y);

		v[y].push_back(x);

	}

	if(dfs(1,0))cout<<"Alice";

	else cout<<"Bob";

}

// Faster C++ solution for the same problem (measured speedup: 6.564923523950924x):
#include<bits/stdc++.h>



using namespace std ;



#define N 200007



int tot , n ;

int nex[2*N] , fire[N] , to[2*N] , sg[N] ;



void add(int u , int v){

    nex[++tot] = fire[u] ;

    fire[u] = tot ;

    to[tot] = v ;

    return ;

}



void dfs(int x , int fr){

    for(int i = fire[x] ; i ; i = nex[i] ){

        int v = to[i] ;

        if( v == fr ) continue ;

        dfs( v , x ) ;

        sg[x] ^= ( sg[v] + 1 ) ;

    }

    return ;

}



int main()

{

    scanf("%d" , &n ) ;

    for(int i = 1 ; i <= n - 1 ; i++ ){

        int u , v ;

        scanf("%d%d" , &u , &v ) ;

        add( u , v ) ; add( v , u ) ;

    }

    dfs( 1 , 0 ) ;

    if( sg[1] ) printf("Alice\n") ;

    else printf("Bob\n") ;

    return 0 ;

}
// Slower C++ solution:
// luogu-judger-enable-o2

//Code by : Y-k-y

#include <iostream>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <queue>

#include <vector>

#include <set>

#define ll long long

const int N=100010;

using namespace std;

inline int rnd(){

	int res=0,f=1;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}

	while(isdigit(ch)){res=res*10+ch-'0';ch=getchar();}

	return res*f;

}

inline void wr(int x){

	if(x<0){putchar('-');x=-x;}if(x>9) wr(x/10);putchar(x%10+'0');

}

vector<int>vec[N];

int n,sg[N];

inline void dfs(int u,int f){

	sg[u]=0;

	for(int i=0;i<vec[u].size();i++){

		int v=vec[u][i];

		if(v==f)continue;

		dfs(v,u);

		sg[u]^=(sg[v]+1);

	}

}

int main(){

	cin>>n;int x,y;

	for(int i=1;i<n;i++){

		x=rnd();y=rnd();

		vec[x].push_back(y);

		vec[y].push_back(x);

	}

	dfs(1,0);

	if(sg[1])puts("Alice");

	else puts("Bob");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 18.463695082921316x):
#include<cstdio>

const int N=400002;

int n,a,b,i,j,k;

int h[N],t[N],v[N],sg[N];

void add(int a,int b){

	t[++k]=h[a];

	h[a]=k;

	v[k]=b;

}

void init(){

	scanf("%d",&n);

	for(i=1;i<n;i++){

		scanf("%d%d",&a,&b);

		add(a,b);

		add(b,a);

	}

}

void dfs(int i,int fa){

	for(int j=h[i];j;j=t[j])

		if(v[j]!=fa){

			dfs(v[j],i);

			sg[i]^=sg[v[j]]+1;

		}

}

int main(){

	init();

	dfs(1,0);

	printf("%s",sg[1]?"Alice":"Bob");

}
// Slower C++ solution:
#include <iostream>

#include <cstdlib>

#include <cstdio>

#define N 200011

using namespace std;

struct apple{

	int v,nxt;

}edge[N*4];

int indexx[N],n,dp[N],tot;

void addedge(int x,int y){

	edge[++tot].v=y;

	edge[tot].nxt=indexx[x];

	indexx[x]=tot;

}

void dfs(int u,int fa){

	int t=indexx[u],vv;

	while(t){

		vv=edge[t].v;

		if(vv!=fa){

			dfs(vv,u);

			dp[u]^=(dp[vv]+1);

		}

		t=edge[t].nxt;

	}

}

int main(){

	int x,y;

	scanf("%d",&n);

	for(int i=1;i<n;i++){

		scanf("%d%d",&x,&y);

		addedge(x,y);

		addedge(y,x);

	}

	dfs(1,0);

	if(dp[1]) printf("Alice\n");

	else printf("Bob\n");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.22238176409613x):
#include <cstdio>

#include <cstring>

#include <cmath>

#include <queue>

#include <algorithm>



#define N 200005



using namespace std;



int n;

int h[N], adj[N], nxt[N], o;



inline void add (int u, int v) {

	nxt[++o] = h[u];

	h[u] = o;

	adj[o] = v;

	return ;

}



int dfs (int u, int la) {

    int sum = 0;

    for (int i = h[u]; i; i = nxt[i]) {

    	int v = adj[i];

    	if (la != v)

    		sum ^= dfs (v, u) + 1; 

    }

    return sum;

}



int main () {

    scanf ("%d", &n);

    for (int i = 1, u, v; i < n; ++i) {

        scanf ("%d%d", &u, &v);

        add (u, v);

        add (v, u); 

    }

    if (dfs (1, 0))

    	puts ("Alice");

    else 

    	puts ("Bob");

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> ii; 



const int N = 2e5 + 10; 

vector<int> adj[N]; 



int dfs(int u, int par = -1) {

	int g = 0; 

	for(int v : adj[u]) if(v - par) 

		g ^= dfs(v, u) + 1; 

	return g; 

}

int main(int argc, char const *argv[]) {

	int n; cin >> n; 

	for(int i = 1; i < n; i++) {

		int u, v; 

		cin >> u >> v;

		adj[u].push_back(v);

		adj[v].push_back(u);

	}	

	puts(dfs(1) ? "Alice" : "Bob"); 

}

// Faster C++ solution for the same problem (measured speedup: 1.8743703234154778x):
#include<cstdio>

#include<vector>

using namespace std;

const int MAXN=100005;



int N;

vector<int> adj[MAXN];

int sg[MAXN];



void dfs(int u,int fa=0)

{

	for(auto v:adj[u])

	{

		if(v==fa)

			continue;

		dfs(v,u);

		sg[u]^=(sg[v]+1);

	}

}



int main()

{

	scanf("%d",&N);

	for(int i=1;i<N;i++)

	{

		int x,y;

		scanf("%d%d",&x,&y);

		adj[x].push_back(y);

		adj[y].push_back(x);

	}

	dfs(1);

	if(sg[1])

		puts("Alice");

	else

		puts("Bob");

	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> ii; 



const int N = 2e5 + 10; 

vector<int> adj[N]; 



int dfs(int u, int par = -1) {

	int g = 0; 

	for(int v : adj[u]) if(v - par) 

		g ^= dfs(v, u) + 1; 

	return g; 

}

int main(int argc, char const *argv[]) {

	int n; cin >> n; 

	for(int i = 1; i < n; i++) {

		int u, v; 

		cin >> u >> v;

		adj[u].push_back(v);

		adj[v].push_back(u);

	}	

	puts(dfs(1) ? "Alice" : "Bob"); 

}

// Faster C++ solution for the same problem (measured speedup: 34.141772722805406x):
#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 100010

int Adj[MAXN],V[MAXN*2],nxt[MAXN*2],c,n;

void AddEdge(int u,int v)

{

	c++;V[c]=v,nxt[c]=Adj[u];Adj[u]=c;

}

int dfs(int u,int p)

{

	int ret=0;

	for(int i=Adj[u];i;i=nxt[i])

		if(V[i]!=p)

		{

			ret^=dfs(V[i],u)+1;

		}

	return ret;

}

int main()

{

	scanf("%d",&n);

	for(int i=1;i<n;i++)

	{

		int u,v;

		scanf("%d%d",&u,&v);

		AddEdge(u,v);

		AddEdge(v,u);

	}

	int ans=dfs(1,0);

	if(ans) printf("Alice\n");

	else printf("Bob\n");

}
// Slower C++ solution:
#include<cstdio>

#include<vector>

using namespace std;

const int MAXN=100005;



int N;

vector<int> adj[MAXN];

int sg[MAXN];



void dfs(int u,int fa=0)

{

	for(auto v:adj[u])

	{

		if(v==fa)

			continue;

		dfs(v,u);

		sg[u]^=(sg[v]+1);

	}

}



int main()

{

	scanf("%d",&N);

	for(int i=1;i<N;i++)

	{

		int x,y;

		scanf("%d%d",&x,&y);

		adj[x].push_back(y);

		adj[y].push_back(x);

	}

	dfs(1);

	if(sg[1])

		puts("Alice");

	else

		puts("Bob");

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 18.215062571302486x):
#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 100010

int Adj[MAXN],V[MAXN*2],nxt[MAXN*2],c,n;

void AddEdge(int u,int v)

{

	c++;V[c]=v,nxt[c]=Adj[u];Adj[u]=c;

}

int dfs(int u,int p)

{

	int ret=0;

	for(int i=Adj[u];i;i=nxt[i])

		if(V[i]!=p)

		{

			ret^=dfs(V[i],u)+1;

		}

	return ret;

}

int main()

{

	scanf("%d",&n);

	for(int i=1;i<n;i++)

	{

		int u,v;

		scanf("%d%d",&u,&v);

		AddEdge(u,v);

		AddEdge(v,u);

	}

	int ans=dfs(1,0);

	if(ans) printf("Alice\n");

	else printf("Bob\n");

}
// Slower C++ solution:
#include<cstdio>

#include<vector>

#define MAXN 100006

#include<algorithm>

using namespace std;

int d[MAXN],n,u,v;

vector<int> road[MAXN];

void DFS(int x,int fa)

{

	for(int i=0;i<(int)road[x].size();i++)

	{

		int nex=road[x][i];

		if(nex==fa) continue;

		DFS(nex,x);

		d[x]^=(d[nex]+1);

	}

}

int main()

{

	scanf("%d",&n);

	for(int i=1;i<n;i++)

	{

		scanf("%d%d",&u,&v);

		road[u].push_back(v);

		road[v].push_back(u);

	}

	DFS(1,0);

	if(d[1]) printf("Alice");

	else printf("Bob");

}

// Faster C++ solution for the same problem (measured speedup: 18.03876767718981x):
#include<cstdio>

#define maxn 100005

int n;

struct node { int v; node *nxt; } edge[maxn*2],*head[maxn],*ncnt;

void addedge(int u,int v)

{

	ncnt++;

	ncnt->v=v,ncnt->nxt=head[u];

	head[u]=ncnt;

}

int dfs(int u,int fa)

{

	int res=0;

	for(node *p=head[u];p;p=p->nxt)

	{

		int v=p->v;

		if(v!=fa) res^=dfs(v,u)+1;

	}

	return res;

}

int main()

{

	scanf("%d",&n);

	ncnt=&edge[0];

	for(int i=1;i<n;i++)

	{

		int u,v;

		scanf("%d%d",&u,&v);

		addedge(u,v); addedge(v,u);

	}

	printf("%s\n",dfs(1,0)?"Alice":"Bob");

}
// Slower C++ solution:
#include <bits/stdc++.h>

//#include <ext/rope>

//

//using namespace __gnu_cxx;



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

#define rep1(i,e) for(int i=1;i<=(e);i++)

#define repx(i,x,e) for(int i=(x);i<=(e);i++)

#define pii pair<int,int>

#define X first

#define Y second

#define PB push_back

#define MP make_pair

#define mset(var,val) memset(var,val,sizeof(var))

#define scd(a) scanf("%d",&a)

#define scdd(a,b) scanf("%d%d",&a,&b)

#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)

#define IOS ios::sync_with_stdio(false);cin.tie(0)



using namespace std;



//#ifdef local

//    #define dbg(args...) do { cout  << #args << " -> "; err(args); cout << endl;} while (0)

//#else

//    #define dbg(...)

//#endif

//

//void err() {  }

////template<template<typename...> class T, typename t, typename... Args>

////void err(T<t> a, Args... args) { for (auto x: a) cout << x << ' '; err(args...); }

//template<typename T, typename... Args>

//void err(T a, Args... args) { cout << a << ' '; err(args...); }





typedef long long ll;

template <class T>

void test(T a) {

    cout<<a<<endl;

}

template <class T,class T2>

void test(T a,T2 b) {

    cout<<a<<" "<<b<<endl;

}

template <class T,class T2,class T3>

void test(T a,T2 b,T3 c) {

    cout<<a<<" "<<b<<" "<<c<<endl;

}

const int inf = 0x3f3f3f3f;

const ll INF = 0x3f3f3f3f3f3f3f3fLL;

const int mod = 1e9+7;



const int N = 1e5+10;



set<int> s;



void work() {

    int n, m;

    scdd(n, m);

    for(int i = 1; i <= sqrt(m+1); ++i){

        if(m%i == 0){

            s.insert(m/i);

            s.insert(i);

        }

    }

    int x = *(s.lower_bound(n));

    printf("%d\n", m/x);

}





int main() {

#ifdef local

    freopen("in.txt","r",stdin);

//        freopen("out1.txt","w",stdout);

#endif // local

//    IOS;

//    init();

    int t;

//    cin >> t;

//    scd(t);

//    for(; t--;)

        work();

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 0.8139618518743141x):
#include <bits/stdc++.h>

using namespace std;

long long n,m,maxn;



int main()

{

	scanf("%lld%lld",&n,&m);

	if(m%n==0)

	{printf("%lld",m/n);

	return 0;

	}

	for(long long i=1;i<=m;i++)

	{

		if(i*n>m)break;

		if(m%i==0&&i*n<=m)maxn=i;

		

	}

	printf("%lld",maxn);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

//#include <ext/rope>

//

//using namespace __gnu_cxx;



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

#define rep1(i,e) for(int i=1;i<=(e);i++)

#define repx(i,x,e) for(int i=(x);i<=(e);i++)

#define pii pair<int,int>

#define X first

#define Y second

#define PB push_back

#define MP make_pair

#define mset(var,val) memset(var,val,sizeof(var))

#define scd(a) scanf("%d",&a)

#define scdd(a,b) scanf("%d%d",&a,&b)

#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)

#define IOS ios::sync_with_stdio(false);cin.tie(0)



using namespace std;



//#ifdef local

//    #define dbg(args...) do { cout  << #args << " -> "; err(args); cout << endl;} while (0)

//#else

//    #define dbg(...)

//#endif

//

//void err() {  }

////template<template<typename...> class T, typename t, typename... Args>

////void err(T<t> a, Args... args) { for (auto x: a) cout << x << ' '; err(args...); }

//template<typename T, typename... Args>

//void err(T a, Args... args) { cout << a << ' '; err(args...); }





typedef long long ll;

template <class T>

void test(T a) {

    cout<<a<<endl;

}

template <class T,class T2>

void test(T a,T2 b) {

    cout<<a<<" "<<b<<endl;

}

template <class T,class T2,class T3>

void test(T a,T2 b,T3 c) {

    cout<<a<<" "<<b<<" "<<c<<endl;

}

const int inf = 0x3f3f3f3f;

const ll INF = 0x3f3f3f3f3f3f3f3fLL;

const int mod = 1e9+7;



const int N = 1e5+10;



set<int> s;



void work() {

    int n, m;

    scdd(n, m);

    for(int i = 1; i <= sqrt(m+1); ++i){

        if(m%i == 0){

            s.insert(m/i);

            s.insert(i);

        }

    }

    int x = *(s.lower_bound(n));

    printf("%d\n", m/x);

}





int main() {

#ifdef local

    freopen("in.txt","r",stdin);

//        freopen("out1.txt","w",stdout);

#endif // local

//    IOS;

//    init();

    int t;

//    cin >> t;

//    scd(t);

//    for(; t--;)

        work();

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.0087980609792033x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

	ll n,m;

	scanf("%lld %lld",&n,&m);

	for(ll i=m/n;i>=1;i--)

	{

		if(m%i==0)

		{

			if(m/i>=n)

			{

				printf("%lld\n",i);

				return 0;

			}

		}

	}

	printf("%d\n",1);

	return 0;	

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

long long n,m,maxn;



int main()

{

	scanf("%lld%lld",&n,&m);

	if(m%n==0)

	{printf("%lld",m/n);

	return 0;

	}

	for(long long i=1;i<=m;i++)

	{

		if(i*n>m)break;

		if(m%i==0&&i*n<=m)maxn=i;

		

	}

	printf("%lld",maxn);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.2393677402156362x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

	ll n,m;

	scanf("%lld %lld",&n,&m);

	for(ll i=m/n;i>=1;i--)

	{

		if(m%i==0)

		{

			if(m/i>=n)

			{

				printf("%lld\n",i);

				return 0;

			}

		}

	}

	printf("%d\n",1);

	return 0;	

}
// Slower C++ solution:
#include <bits/stdc++.h>

//#include <ext/rope>

//

//using namespace __gnu_cxx;



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

#define rep1(i,e) for(int i=1;i<=(e);i++)

#define repx(i,x,e) for(int i=(x);i<=(e);i++)

#define pii pair<int,int>

#define X first

#define Y second

#define PB push_back

#define MP make_pair

#define mset(var,val) memset(var,val,sizeof(var))

#define scd(a) scanf("%d",&a)

#define scdd(a,b) scanf("%d%d",&a,&b)

#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)

#define IOS ios::sync_with_stdio(false);cin.tie(0)



using namespace std;



//#ifdef local

//    #define dbg(args...) do { cout  << #args << " -> "; err(args); cout << endl;} while (0)

//#else

//    #define dbg(...)

//#endif

//

//void err() {  }

////template<template<typename...> class T, typename t, typename... Args>

////void err(T<t> a, Args... args) { for (auto x: a) cout << x << ' '; err(args...); }

//template<typename T, typename... Args>

//void err(T a, Args... args) { cout << a << ' '; err(args...); }





typedef long long ll;

template <class T>

void test(T a) {

    cout<<a<<endl;

}

template <class T,class T2>

void test(T a,T2 b) {

    cout<<a<<" "<<b<<endl;

}

template <class T,class T2,class T3>

void test(T a,T2 b,T3 c) {

    cout<<a<<" "<<b<<" "<<c<<endl;

}

const int inf = 0x3f3f3f3f;

const ll INF = 0x3f3f3f3f3f3f3f3fLL;

const int mod = 1e9+7;



const int N = 1e5+10;



set<int> s;



void work() {

    int n, m;

    scdd(n, m);

    for(int i = 1; i <= sqrt(m+1); ++i){

        if(m%i == 0){

            s.insert(m/i);

            s.insert(i);

        }

    }

    int x = *(s.lower_bound(n));

    printf("%d\n", m/x);

}





int main() {

#ifdef local

    freopen("in.txt","r",stdin);

//        freopen("out1.txt","w",stdout);

#endif // local

//    IOS;

//    init();

    int t;

//    cin >> t;

//    scd(t);

//    for(; t--;)

        work();

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 0.8263942897995705x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	long long n,m,maxn;

	scanf("%lld%lld",&n,&m);

	if(m%n==0)

	{cout<<m/n;

	return 0;}

	for(long long i=1;i<=m;i++)

	{

		if(m%i==0&&n*i<=m)

		{

		maxn=i;}

		if(n*i>m)break;

	}

	cout<<maxn;

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



const long long linf = 1e18 + 7;

const int inf = 1e9 + 7;

const int N = 1e6 + 5;



main(){

    int n, m;

    cin >> n >> m;

    int cur = m / n + 1;

    while (cur--){

        if (cur == 1){

            cout << 1;

            return 0;

        }

        if ((m - cur * n) % cur == 0){

            cout << cur;

            return 0;

        }

    }

}


// Faster C++ solution for the same problem (measured speedup: 2.534549611611629x):
#include<cstdio>

using namespace std;

int main()

{

	int n,m,k;

	scanf("%d%d",&n,&m);

	k=m/n;

	for(int i=k;i>=1;i--)

	if(m%i==0)

	{

		printf("%d",i);

		return 0;

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

//#include <ext/rope>

//

//using namespace __gnu_cxx;



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

#define rep1(i,e) for(int i=1;i<=(e);i++)

#define repx(i,x,e) for(int i=(x);i<=(e);i++)

#define pii pair<int,int>

#define X first

#define Y second

#define PB push_back

#define MP make_pair

#define mset(var,val) memset(var,val,sizeof(var))

#define scd(a) scanf("%d",&a)

#define scdd(a,b) scanf("%d%d",&a,&b)

#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)

#define IOS ios::sync_with_stdio(false);cin.tie(0)



using namespace std;



//#ifdef local

//    #define dbg(args...) do { cout  << #args << " -> "; err(args); cout << endl;} while (0)

//#else

//    #define dbg(...)

//#endif

//

//void err() {  }

////template<template<typename...> class T, typename t, typename... Args>

////void err(T<t> a, Args... args) { for (auto x: a) cout << x << ' '; err(args...); }

//template<typename T, typename... Args>

//void err(T a, Args... args) { cout << a << ' '; err(args...); }





typedef long long ll;

template <class T>

void test(T a) {

    cout<<a<<endl;

}

template <class T,class T2>

void test(T a,T2 b) {

    cout<<a<<" "<<b<<endl;

}

template <class T,class T2,class T3>

void test(T a,T2 b,T3 c) {

    cout<<a<<" "<<b<<" "<<c<<endl;

}

const int inf = 0x3f3f3f3f;

const ll INF = 0x3f3f3f3f3f3f3f3fLL;

const int mod = 1e9+7;



const int N = 1e5+10;



set<int> s;



void work() {

    int n, m;

    scdd(n, m);

    for(int i = 1; i <= sqrt(m+1); ++i){

        if(m%i == 0){

            s.insert(m/i);

            s.insert(i);

        }

    }

    int x = *(s.lower_bound(n));

    printf("%d\n", m/x);

}





int main() {

#ifdef local

    freopen("in.txt","r",stdin);

//        freopen("out1.txt","w",stdout);

#endif // local

//    IOS;

//    init();

    int t;

//    cin >> t;

//    scd(t);

//    for(; t--;)

        work();

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.5570385837876257x):
#include<cstdio>

using namespace std;

int main()

{

	int n,m,k;

	scanf("%d%d",&n,&m);

	k=m/n;

	for(int i=k;i>=1;i--)

	if(m%i==0)

	{

		printf("%d",i);

		return 0;

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

long long n,m,maxn;



int main()

{

	scanf("%lld%lld",&n,&m);

	if(m%n==0)

	{printf("%lld",m/n);

	return 0;

	}

	for(long long i=1;i<=m;i++)

	{

		if(i*n>m)break;

		if(m%i==0&&i*n<=m)maxn=i;

		

	}

	printf("%lld",maxn);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.141472266666453x):
#include<cstdio>

using namespace std;

int main()

{

	int n,m,k;

	scanf("%d%d",&n,&m);

	k=m/n;

	for(int i=k;i>=1;i--)

	if(m%i==0)

	{

		printf("%d",i);

		return 0;

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

	ll n,m;

	scanf("%lld %lld",&n,&m);

	for(ll i=m/n;i>=1;i--)

	{

		if(m%i==0)

		{

			if(m/i>=n)

			{

				printf("%lld\n",i);

				return 0;

			}

		}

	}

	printf("%d\n",1);

	return 0;	

}

// Faster C++ solution for the same problem (measured speedup: 2.5347378060041095x):
#include<cstdio>

using namespace std;

int main()

{

	int n,m,k;

	scanf("%d%d",&n,&m);

	k=m/n;

	for(int i=k;i>=1;i--)

	if(m%i==0)

	{

		printf("%d",i);

		return 0;

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

	long long n,m,maxn;

	scanf("%lld%lld",&n,&m);

	if(m%n==0)

	{cout<<m/n;

	return 0;}

	for(long long i=1;i<=m;i++)

	{

		if(m%i==0&&n*i<=m)

		{

		maxn=i;}

		if(n*i>m)break;

	}

	cout<<maxn;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.0942113411841174x):
#include<cstdio>

using namespace std;

int main()

{

	int n,m,k;

	scanf("%d%d",&n,&m);

	k=m/n;

	for(int i=k;i>=1;i--)

	if(m%i==0)

	{

		printf("%d",i);

		return 0;

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

long long n,m,maxn;



int main()

{

	scanf("%lld%lld",&n,&m);

	if(m%n==0)

	{printf("%lld",m/n);

	return 0;

	}

	for(long long i=1;i<=m;i++)

	{

		if(i*n>m)break;

		if(m%i==0&&i*n<=m)maxn=i;

		

	}

	printf("%lld",maxn);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.2416590206445275x):
#include<cstdio>

#include<iostream>

#include<fstream>

#include<cmath>

#include<cstring>

#include<algorithm>

using namespace std;

#define Set(a) memset(a,0,sizeof(a))

#define F(i,a,b) for(register int i=a;i<=b;++i)

#define UF(i,a,b) for(register int i=a;i>=b;--i)

#define openf(a) freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)

typedef long long LL;

typedef long long ll;

typedef unsigned long long ULL;

typedef unsigned long long ull;

inline int r(int &x)

{

    int f=1;x=0;

    char c=getchar();

    for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;

    for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+c-'0';

    return x*=f;

}

inline ll r(ll &x)

{

    ll f=1ll;x=0ll;

    char c=getchar();

    for(;!isdigit(c);c=getchar()) if(c=='-') f=-1ll;

    for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(ll)(c-'0');

    return x*=f;

}

inline ull r(ull &x)

{

    x=0ull;

    char c=getchar();

    for(;!isdigit(c);c=getchar());

    for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(ull)(c-'0');

    return x;

}

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

#define mp(a,b) make_pair(a,b)

inline int max(int a,int b){return a>b?a:b;}

inline int min(int a,int b){return a<b?a:b;}

const int inf=1<<30;



int m,n;

int main()

{

	r(n),r(m);

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

	return 0;

}