stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <iomanip>



#include <vector>

#include <cstring>

#include <string>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <list>



#include <cmath>

#include <algorithm>

#include <cassert>

#include <bitset>

#include <complex>



using namespace std;



typedef long long ll;

typedef pair<int, int> ii;

typedef pair<ll, ll> l4;



#define mp make_pair

#define pb push_back



const int maxn = 2e5+1;

int n, a[maxn], sorted[maxn];



int main()

{

  scanf("%d", &n);

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

    scanf("%d", a+i);

  memcpy(sorted, a, sizeof(sorted));

  sort(sorted+1, sorted+1+n);

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

    printf("%d\n", a[i]<=sorted[n/2]?sorted[n/2+1]:sorted[n/2]);

}


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

#include <algorithm>

using namespace std;



int main()

{

    int n;

    cin>>n;

    int A[n],B[n];

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

        cin>>A[i];

        B[i]=A[i];

}

    sort(A,A+n);

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

        if(B[i]<=A[n/2-1]){

            cout<<A[n/2]<<endl;

        }else {cout<<A[n/2-1]<<endl;}

    }

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

#include <cstdio>

#include <cstdlib>

#include <iomanip>



#include <vector>

#include <cstring>

#include <string>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <list>



#include <cmath>

#include <algorithm>

#include <cassert>

#include <bitset>

#include <complex>



using namespace std;



typedef long long ll;

typedef pair<int, int> ii;

typedef pair<ll, ll> l4;



#define mp make_pair

#define pb push_back



const int maxn = 2e5+1;

int n, a[maxn], sorted[maxn];



int main()

{

  scanf("%d", &n);

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

    scanf("%d", a+i);

  memcpy(sorted, a, sizeof(sorted));

  sort(sorted+1, sorted+1+n);

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

    printf("%d\n", a[i]<=sorted[n/2]?sorted[n/2+1]:sorted[n/2]);

}


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

using namespace std;

int main(){

    int n,x;

    scanf("%d",&n);

    int a[n],b[n];

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

        scanf("%d",&a[i]);

        b[i]=a[i];

    }

    sort(b,b+n);

    int mid=b[(n/2-1)];

    int midn=b[(n/2)];

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

        if(a[i]<=mid){

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

        }

        else

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

    }



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

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e18;

template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }

template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }

template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }

template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }



/*

 <url:>

 問題文============================================================

 =================================================================

 解説=============================================================

 ================================================================

 */





ll solve(){

    ll res = 0;

    

    ll N; cin >> N;

    vector<ll> X(N); for(auto& in:X) cin >> in;

    auto tX = X;

    sort(tX.begin(),tX.end());

    ll T = tX[N/2];

    

    for(int i = 0; i < N;i++){

        if(X[i] >= T){

            cout << tX[N/2-1] << endl;

        }else{

            cout << T << endl;

        }

    }

    

    

    return res;

}

int main(void) {

    cin.tie(0); ios_base::sync_with_stdio(false);

    solve();

    return 0;

}


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

#include<algorithm>

using namespace std;

int a[200010],b[200010];

main(){

    int n,i,x,y;

    scanf("%d",&n);

    for(i=0;i<n;++i)

    {

        scanf("%d",&a[i]);

        b[i]=a[i];

    }

    sort(b,b+n);

    x=b[(n/2)-1];

    y=b[(n/2)];

    if(x==y)

    {

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

        {

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

        }

    }

    else

    {

        for(i=0;i<n;++i)

        {

            if(a[i]<=x)

            {

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

            }

            else

            {

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

            }

        }

    }

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



using namespace std;

typedef long long ll;

ll MAX_N = 200005;



int main() {

  ll n;

  ll x[MAX_N], y[MAX_N];

  scanf("%lld", &n);

  for (ll i=0; i<n; i++) {

    scanf("%lld", &x[i]);

    y[i] = x[i];

  }

  sort(y, y+n);

  

  ll m = n/2 - 1;

  for (ll i=0; i<n; i++) {

    if (y[m] < x[i]) {

      printf("%lld\n", y[m]);

    } else {

      printf("%lld\n", y[m+1]);

    }

  }

  

  return 0;

}


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

#include<algorithm>

using namespace std;

int a[200010],b[200010];

main(){

    int n,i,x,y;

    scanf("%d",&n);

    for(i=0;i<n;++i)

    {

        scanf("%d",&a[i]);

        b[i]=a[i];

    }

    sort(b,b+n);

    x=b[(n/2)-1];

    y=b[(n/2)];

    if(x==y)

    {

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

        {

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

        }

    }

    else

    {

        for(i=0;i<n;++i)

        {

            if(a[i]<=x)

            {

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

            }

            else

            {

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

            }

        }

    }

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

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e18;

template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }

template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }

template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }

template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }



/*

 <url:>

 問題文============================================================

 =================================================================

 解説=============================================================

 ================================================================

 */





ll solve(){

    ll res = 0;

    

    ll N; cin >> N;

    vector<ll> X(N); for(auto& in:X) cin >> in;

    auto tX = X;

    sort(tX.begin(),tX.end());

    ll T = tX[N/2];

    

    for(int i = 0; i < N;i++){

        if(X[i] >= T){

            cout << tX[N/2-1] << endl;

        }else{

            cout << T << endl;

        }

    }

    

    

    return res;

}

int main(void) {

    cin.tie(0); ios_base::sync_with_stdio(false);

    solve();

    return 0;

}


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

#include <vector>

#include <algorithm>

using namespace std;

vector <int> que,ans;



int main()

{

    int n,pp;

    scanf("%d",&n);

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

    {

        scanf("%d",&pp);

        que.push_back(pp);

        ans.push_back(pp);

    }

    sort(ans.begin(),ans.end());

    int med = ans[n/2];

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

    {

        if(que[i]<med)

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

        else

            printf("%d\n",ans[n/2-1]);

    }

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



using namespace std;

typedef long long ll;

ll MAX_N = 200005;



int main() {

  ll n;

  ll x[MAX_N], y[MAX_N];

  scanf("%lld", &n);

  for (ll i=0; i<n; i++) {

    scanf("%lld", &x[i]);

    y[i] = x[i];

  }

  sort(y, y+n);

  

  ll m = n/2 - 1;

  for (ll i=0; i<n; i++) {

    if (y[m] < x[i]) {

      printf("%lld\n", y[m]);

    } else {

      printf("%lld\n", y[m+1]);

    }

  }

  

  return 0;

}


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

#include <vector>

#include <algorithm>

using namespace std;

vector <int> que,ans;



int main()

{

    int n,pp;

    scanf("%d",&n);

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

    {

        scanf("%d",&pp);

        que.push_back(pp);

        ans.push_back(pp);

    }

    sort(ans.begin(),ans.end());

    int med = ans[n/2];

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

    {

        if(que[i]<med)

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

        else

            printf("%d\n",ans[n/2-1]);

    }

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

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e18;

template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }

template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }

template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }

template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }



/*

 <url:>

 問題文============================================================

 =================================================================

 解説=============================================================

 ================================================================

 */





ll solve(){

    ll res = 0;

    

    ll N; cin >> N;

    vector<ll> X(N); for(auto& in:X) cin >> in;

    auto tX = X;

    sort(tX.begin(),tX.end());

    ll T = tX[N/2];

    

    for(int i = 0; i < N;i++){

        if(X[i] >= T){

            cout << tX[N/2-1] << endl;

        }else{

            cout << T << endl;

        }

    }

    

    

    return res;

}

int main(void) {

    cin.tie(0); ios_base::sync_with_stdio(false);

    solve();

    return 0;

}


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

#include <algorithm>

using std::sort;

int main(void)

{

	int *a,*b,i,N;

	int frontHalf,backHalf;

	scanf("%d",&N);

	a= new int [N];

	b= new int [N];

	for(i=0;i<N;i++)

	{

		scanf("%d",a+i);

		b[i]=a[i];

	}

	sort(b,b+N);

	frontHalf=b[N/2-1];

	backHalf=b[N/2];

	delete [] b;

	for(i=0;i<N;i++)

	{

		if(a[i]<backHalf)

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

		else

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

	}

	delete [] a;

	return 0;

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



using namespace std;

typedef long long ll;

ll MAX_N = 200005;



int main() {

  ll n;

  ll x[MAX_N], y[MAX_N];

  scanf("%lld", &n);

  for (ll i=0; i<n; i++) {

    scanf("%lld", &x[i]);

    y[i] = x[i];

  }

  sort(y, y+n);

  

  ll m = n/2 - 1;

  for (ll i=0; i<n; i++) {

    if (y[m] < x[i]) {

      printf("%lld\n", y[m]);

    } else {

      printf("%lld\n", y[m+1]);

    }

  }

  

  return 0;

}


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

#include <algorithm>

using std::sort;

int main(void)

{

	int *a,*b,i,N;

	int frontHalf,backHalf;

	scanf("%d",&N);

	a= new int [N];

	b= new int [N];

	for(i=0;i<N;i++)

	{

		scanf("%d",a+i);

		b[i]=a[i];

	}

	sort(b,b+N);

	frontHalf=b[N/2-1];

	backHalf=b[N/2];

	delete [] b;

	for(i=0;i<N;i++)

	{

		if(a[i]<backHalf)

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

		else

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

	}

	delete [] a;

	return 0;

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

const char nl = '\n';

using namespace std;

using ll = long long;

using ld = long double;

const int N = 1e4+10;



int d[N*2];



int main() {

  ios::sync_with_stdio(0);

  cin.tie(0);

  int k, q; cin >> k >> q;

  for (int i = 0; i < k; i++) {

    cin >> d[i];

  }

  int nk = k;

  while (nk < N) nk += k;

  for (int i = k; i < nk; i++) {

    d[i] = d[i%k];

  }

  k = nk;

  while (q--) {

    int n, x, m; cin >> n >> x >> m;

    n--;

    x %= m;

    ll tot = 0;

    int zcnt = 0;

    for (int i = 0; i < k; i++) {

      tot += (d[i] % m);

      zcnt += (d[i] % m == 0);

    }

    int num_cyc = n / k, rem_cyc = n % k;

    ll ans = num_cyc * k - (x + tot * num_cyc) / m - num_cyc * zcnt;

    //cout << ans << nl;

    x = (x + tot * num_cyc) % m;

    for (int i = 0; i < rem_cyc; i++) {

      int nx = (x + d[i]) % m;

      //cerr << x << " " << nx << nl;

      ans += (x < nx);

      x = nx;

    }

    cout << ans << nl;

  }

}


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

const char nl = '\n';

using namespace std;

using ll = long long;

using ld = long double;

const int N = 5050;



int d[N*2];



int main() {

  ios::sync_with_stdio(0);

  cin.tie(0);

  int k, q; cin >> k >> q;

  for (int i = 0; i < k; i++) {

    cin >> d[i];

  }

  /*

  int nk = k;

  while (nk < N) nk += k;

  for (int i = k; i < nk; i++) {

    d[i] = d[i%k];

  }

  k = nk;*/

  while (q--) {

    int n, x, m; cin >> n >> x >> m;

    n--;

    x %= m;

    ll tot = 0;

    int zcnt = 0;

    for (int i = 0; i < k; i++) {

      tot += (d[i] % m);

      zcnt += (d[i] % m == 0);

    }

    int num_cyc = n / k, rem_cyc = n % k;

    ll ans = num_cyc * k - (x + tot * num_cyc) / m - num_cyc * zcnt;

    //cout << ans << nl;

    x = (x + tot * num_cyc) % m;

    for (int i = 0; i < rem_cyc; i++) {

      int nx = (x + d[i]) % m;

      //cerr << x << " " << nx << nl;

      ans += (x < nx);

      x = nx;

    }

    cout << ans << nl;

  }

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

#include<algorithm>

#include<vector>

#include<queue>

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

#define mod 1000000007

typedef long long ll;



using namespace std;

#define N 100010

ll n,a[N];

ll f[N],g[N],h[N],cs[N];

int main(){

    cin>>n;lol(i,n)cin>>a[i];

    f[0]=1;

    for(ll i=1;i<N;i++)f[i]=f[i-1]*i%mod;

    g[n+1]=1;

    for(ll i=n;i>=1;i--)g[i]=g[i+1]*i%mod;

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

	h[i+1]=f[i]*g[i+2]%mod;

    }h[1]=g[2];

    cs[0]=cs[1]=0;

    for(ll i=2;i<N;i++)cs[i]=(cs[i-1]+h[i])%mod;

    ll ans=0;

    lol(i,n){

	ll cur=cs[i+1]+cs[n-i]+h[1];

	ans=(ans+cur*a[i])%mod;

    }

    cout<<ans<<endl;

    return 0;

}


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

#include<algorithm>

#include<vector>

#include<queue>

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

#define mod 1000000007

typedef long long ll;

using namespace std;

#define N 100010

ll n,a[N];

ll f[N],g[N];

ll val[N],cs[N];

int main(){

    cin>>n;

    lol(i,n)cin>>a[i];

    f[0]=1;

    for(ll i=1;i<=n;i++)f[i]=f[i-1]*i%mod;

    g[n+1]=1;

    for(ll i=n;i>=1;i--)g[i]=g[i+1]*i%mod;

    for(ll i=2;i<=n;i++){

	val[i]=f[i-1]*g[i+1]%mod;

    }

    val[1]=g[2];

    cs[0]=cs[1]=0;

    for(ll i=2;i<=n;i++)cs[i]=(cs[i-1]+val[i])%mod;

    ll ans=0;

    lol(i,n){

	ll cur=cs[i+1]+cs[n-i]+val[1];

	ans=(ans+cur*a[i])%mod;

    }

    return cout<<ans<<endl,0;

}
// Slower C++ solution:
//此程序使用了qt专属名称，请勿模仿。侵权必究！！！

//我真是太菜了…… 

#include<bits/stdc++.h>

using namespace std;

#define ll long long

const ll N=20,P=1e9+7;

ll n,m,ans=1,a[1<<N]={1};

inline ll read()

{

	ll sum=0,flag=1;

	char c;

	for(;c<'0'||c>'9';c=getchar())if(c=='-') flag=-1;

	for(;c>='0'&&c<='9';c=getchar())sum=(sum<<1)+(sum<<3)+c-'0';

	return sum*flag;

}

inline ll pow(ll x,ll y)

{

	ll k=1;

	while(y)

	{

		if(y&1)

		{

			k*=x;

			k%=P;

		}

		y>>=1;

		x*=x;

		x%=P;

	}

	return k;

}

int main()

{

//	freopen("a.in","r",stdin);

//	freopen("a.out","w",stdout);

	n=read();

	m=read();

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

	{

		a[i]=a[i-1]*i%P;

	}

	for(ll i=2;i*i<=m;++i)

	{

		if(!(m%i))

		{

			ll k=0;

			while(!(m%i))

			{

				++k;

				m/=i;

			}

			ans*=a[n+k-1]%P*pow(a[n-1],P-2)%P*pow(a[k],P-2)%P;

			ans%=P;

		}

	}

	if(m>1)

	{

		ans*=n;

		ans%=P;

	}

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

	return 0;

}






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

#define ll long long

using namespace std;

const int mod=1e9+7;

int n,m,sum=0;

int p[100005];

ll fuc[101105],inv[101105];

ll ans=1;

ll pow2(ll a,ll b)

{

	ll ans=1;

	while(b)

	{

		if(b%2) ans=ans*a%mod;

		b/=2; a=a*a%mod;

	}

	return ans;

}

void divide(int x)

{

    sum=0;

	for(int i=2;i<=sqrt(x);i++)

	{

		if(x%i==0)

		{

			sum++;

			while(x%i==0)

			{

				x/=i;

				p[sum]++;

			}

		}

	}

	if(x>1)

	{

		p[++sum]++;

	}

}

int main()

{

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

//freopen(".out","w",stdout);

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

  divide(m); 

  fuc[1]=1;

  for(int i=2;i<=101000+100;i++)

    fuc[i]=(ll)(fuc[i-1]*i)%mod;

  inv[101000+100]=pow2(fuc[101000+100],mod-2);

  inv[0]=1;

  for(int i=101000+99;i>=1;i--)

    inv[i]=(ll)(inv[i+1]*(i+1))%mod;

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

  {

  	ans=(ll)ans*(ll)(fuc[p[i]-1+n]%mod*inv[n-1]%mod*inv[p[i]]%mod)%mod;

  	ans=ans%mod;

  }

  cout<<ans<<endl;

  return 0;

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



using namespace std;



typedef long long ll;



const int N = 2e5 + 5;

const ll mod = 1e9 + 7;



ll fact[N];

int n, m;



ll bigmod(ll p, ll q) {

  ll res = 1;

  while(q > 0) {

    if(q & 1) {

      res = (res * p) % mod;

    }

    q >>= 1;

    p = (p * p) % mod;

  }

  return res;

}



ll inverse(ll p) {

  return bigmod(p, mod - 2);

}



ll ncr(ll p, ll q) {

  if(p < q or p < 0 or q < 0) return 0;

  ll up = fact[p];

  ll down = ((fact[q] % mod) * (fact[p - q] % mod)) % mod;

  return ((up % mod) * inverse(down)) % mod;

}



int main() {

  fact[0] = fact[1] = 1;

  for(int i = 2; i < N; i++) {

    fact[i] = (fact[i - 1] * i) % mod;

  }

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

  vector <int> prime;

  for(int i = 2; i * i <= m; i++) {

    if(m % i == 0) {

      int cnt = 0;

      while(m % i == 0) {

        m /= i;

        cnt++;

      }

      prime.push_back(cnt);

    }

  }

  if(m > 1) {

    prime.push_back(1);

  }

  ll ans = 1ll;

  for(auto c : prime) {

    ans = (ans * ncr(n + c - 1, c)) % mod;

  }

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

  return 0;

}

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

using namespace std;

#define ll long long



const ll MOD = 1e9+7;

ll n, m, ans = 1, cnt=0, tot=0, sum[100050];



void getprime(){

	for(ll i = 2; i <= m; i++){

		if(m % i == 0){

			m /= i;

			sum[++cnt]++;

			while(m % i == 0)  

				m /= i, sum[cnt]++;

			tot += sum[cnt];

		}

	}

	if(m != 1) sum[++cnt] = 1, tot++;

}



ll inv(ll x){

    return x==1 ? 1 : (MOD-MOD/x)*inv(MOD%x)%MOD;

}

ll C(ll n,ll m){

    if(m<0 || n<m) return 0;

    if(m > n-m)  m = n-m;

    ll zi = 1, mu = 1;

    for(ll i = 0; i < m; i++){

        zi = zi *(n-i) %MOD;

        mu = mu *(i+1) %MOD;

    }

    return zi*inv(mu)%MOD;

}



int main(){

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

	getprime();

	for(ll i = 1; i <= cnt; i++){

		ans *= C(sum[i]+n-1, n-1);

		ans %= MOD;

	}

	printf("%lld", ans);

	return 0;

}
// Slower C++ solution:
//此程序使用了qt专属名称，请勿模仿。侵权必究！！！

//我真是太菜了…… 

#include<bits/stdc++.h>

using namespace std;

#define ll long long

const ll N=20,P=1e9+7;

ll n,m,ans=1,a[1<<N]={1};

inline ll read()

{

	ll sum=0,flag=1;

	char c;

	for(;c<'0'||c>'9';c=getchar())if(c=='-') flag=-1;

	for(;c>='0'&&c<='9';c=getchar())sum=(sum<<1)+(sum<<3)+c-'0';

	return sum*flag;

}

inline ll pow(ll x,ll y)

{

	ll k=1;

	while(y)

	{

		if(y&1)

		{

			k*=x;

			k%=P;

		}

		y>>=1;

		x*=x;

		x%=P;

	}

	return k;

}

int main()

{

//	freopen("a.in","r",stdin);

//	freopen("a.out","w",stdout);

	n=read();

	m=read();

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

	{

		a[i]=a[i-1]*i%P;

	}

	for(ll i=2;i*i<=m;++i)

	{

		if(!(m%i))

		{

			ll k=0;

			while(!(m%i))

			{

				++k;

				m/=i;

			}

			ans*=a[n+k-1]%P*pow(a[n-1],P-2)%P*pow(a[k],P-2)%P;

			ans%=P;

		}

	}

	if(m>1)

	{

		ans*=n;

		ans%=P;

	}

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

	return 0;

}






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

using namespace std;

#define ll long long



const ll MOD = 1e9+7;

ll n, m, ans = 1, cnt=0, tot=0, sum[100050];



void getprime(){

	for(ll i = 2; i <= m; i++){

		if(m % i == 0){

			m /= i;

			sum[++cnt]++;

			while(m % i == 0)  

				m /= i, sum[cnt]++;

			tot += sum[cnt];

		}

	}

	if(m != 1) sum[++cnt] = 1, tot++;

}



ll inv(ll x){

    return x==1 ? 1 : (MOD-MOD/x)*inv(MOD%x)%MOD;

}

ll C(ll n,ll m){

    if(m<0 || n<m) return 0;

    if(m > n-m)  m = n-m;

    ll zi = 1, mu = 1;

    for(ll i = 0; i < m; i++){

        zi = zi *(n-i) %MOD;

        mu = mu *(i+1) %MOD;

    }

    return zi*inv(mu)%MOD;

}



int main(){

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

	getprime();

	for(ll i = 1; i <= cnt; i++){

		ans *= C(sum[i]+n-1, n-1);

		ans %= MOD;

	}

	printf("%lld", ans);

	return 0;

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

#define ll long long

using namespace std;

const int mod=1e9+7;

int n,m,sum=0;

int p[100005];

ll fuc[101105],inv[101105];

ll ans=1;

ll pow2(ll a,ll b)

{

	ll ans=1;

	while(b)

	{

		if(b%2) ans=ans*a%mod;

		b/=2; a=a*a%mod;

	}

	return ans;

}

void divide(int x)

{

    sum=0;

	for(int i=2;i<=sqrt(x);i++)

	{

		if(x%i==0)

		{

			sum++;

			while(x%i==0)

			{

				x/=i;

				p[sum]++;

			}

		}

	}

	if(x>1)

	{

		p[++sum]++;

	}

}

int main()

{

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

//freopen(".out","w",stdout);

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

  divide(m); 

  fuc[1]=1;

  for(int i=2;i<=101000+100;i++)

    fuc[i]=(ll)(fuc[i-1]*i)%mod;

  inv[101000+100]=pow2(fuc[101000+100],mod-2);

  inv[0]=1;

  for(int i=101000+99;i>=1;i--)

    inv[i]=(ll)(inv[i+1]*(i+1))%mod;

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

  {

  	ans=(ll)ans*(ll)(fuc[p[i]-1+n]%mod*inv[n-1]%mod*inv[p[i]]%mod)%mod;

  	ans=ans%mod;

  }

  cout<<ans<<endl;

  return 0;

}


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

using namespace std;

#define ll long long



const ll MOD = 1e9+7;

ll n, m, ans = 1, cnt=0, tot=0, sum[100050];



void getprime(){

	for(ll i = 2; i <= m; i++){

		if(m % i == 0){

			m /= i;

			sum[++cnt]++;

			while(m % i == 0)  

				m /= i, sum[cnt]++;

			tot += sum[cnt];

		}

	}

	if(m != 1) sum[++cnt] = 1, tot++;

}



ll inv(ll x){

    return x==1 ? 1 : (MOD-MOD/x)*inv(MOD%x)%MOD;

}

ll C(ll n,ll m){

    if(m<0 || n<m) return 0;

    if(m > n-m)  m = n-m;

    ll zi = 1, mu = 1;

    for(ll i = 0; i < m; i++){

        zi = zi *(n-i) %MOD;

        mu = mu *(i+1) %MOD;

    }

    return zi*inv(mu)%MOD;

}



int main(){

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

	getprime();

	for(ll i = 1; i <= cnt; i++){

		ans *= C(sum[i]+n-1, n-1);

		ans %= MOD;

	}

	printf("%lld", ans);

	return 0;

}