Language: C++

#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
#include <cstdio>
#include <string>
#include <bitset>
#include <list>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <functional>
#include <queue>
#include <regex>
#include <cassert>
#include <map>
// #include "bits/stdc++.h"

using namespace std;
//debug

#define rep(i, N, M) for (ll i = N; i < M; ++i)
#define rrep(i, N, M) for (ll i = N; i > M; --i)
#define pb push_back


typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef priority_queue<ll> pqll;
typedef priority_queue<pll, vector<pll>> pqpll;
typedef priority_queue<ll, vll, greater<ll>> pqll_greater;
typedef priority_queue<pll, vector<pll>, greater<pll>> pqpll_greater;


#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define vec(a) vector<a>
#define _CRT_SECURE_NO_WARNINGS

template<class T, class S>
T atbit(T n, S i) {
	return (n >> i) % i;
}

template<class T>
T getbit(T i) {
	return 1LL << i;
}
template<class T>
T POW(T n, T m) {
	T res = 1;
	rep(i, 0, m) {
		res *= n;
	}
	return res;
}

ll power(ll x, ll y, ll mod) {
	if (y == 0)return 1;
	if (y == 1)return x % mod;
	if (y % 2 == 0)return POW(power(x, y / 2, mod), 2LL) % mod;
	return ((POW(power(x, y / 2, mod), 2LL) % mod)*(x%mod)) % mod;
}
ll div(ll a, ll  b, ll mod) {
	return (a* power(b, mod - 2, mod)) % mod;
}

//#define TRANSFORM(v,w,func) decltype(v) w ; transform((v).begin(),(v).end(),back_inserter(w),func);

using namespace std;

ll MOD_NUM = POW(10LL, 9LL) + 7;

vector<pll >prime_factorize(ll n) {
	vector<pll> res;
	for (ll p = 2; p*p <= n; ++p) {
		if (n%p != 0)continue;
		ll num = 0;
		while (n%p == 0) { ++num; n /= p; }
		res.push_back({ p,num });
	}
	if (n != 1) res.push_back(make_pair(n, 1));
	return res;
}

class Combination {
	// this calculates combination (nCk).
	// Constructor runs in O(MAX).
	// get(n,k) returns nCk in O(1).

	ll MAX, MOD;
	vll fac;
	vll finv;
	vll inv;
public:
	Combination(ll MAX = 210000, ll MOD = 1000000007)
		:MOD(MOD), MAX(MAX), fac(vll(MAX)), finv(vll(MAX)), inv(vll(MAX)) {
		fac[0] = fac[1] = 1;
		finv[0] = finv[1] = 1;
		inv[1] = 1;
		rep(i, 2, MAX) {
			fac[i] = fac[i - 1] * i % MOD;
			inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
			finv[i] = finv[i - 1] * inv[i] % MOD;
		}
	}

	ll get(ll n, ll k) {
		if (n < k)return 0;
		if (n < 0 || k < 0)return 0;
		return fac[n] * (finv[k] * finv[n - k]%MOD )% MOD;
	}
};

int main() {
	ll n, m;
	cin >> n >> m;
	auto fac = prime_factorize(m);
	auto cb = Combination(2*n);
	ll res=1LL;
	for each (auto  i in fac)
	{
		auto num = i.second;
		res = res * cb.get(num + n - 1, n - 1)%MOD_NUM;
		
	}
	
	cout << res;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:129:13: error: expected '(' before 'each'
  129 |         for each (auto  i in fac)
      |             ^~~~
      |             (
a.cc:129:19: error: expected primary-expression before 'auto'
  129 |         for each (auto  i in fac)
      |                   ^~~~
a.cc:129:13: error: 'each' was not declared in this scope
  129 |         for each (auto  i in fac)
      |             ^~~~
a.cc:137:1: error: expected primary-expression before '}' token
  137 | }
      | ^
a.cc:136:21: error: expected ')' before '}' token
  136 |         cout << res;
      |                     ^
      |                     )
  137 | }
      | ~                    
a.cc:129:13: note: to match this '('
  129 |         for each (auto  i in fac)
      |             ^~~~
a.cc:137:1: error: expected primary-expression before '}' token
  137 | }
      | ^