#pragma GCC optimize("O3") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using P = pair; using T = tuple; template inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;} template inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;} constexpr int MOD = 1e9 + 7; constexpr int inf = 1e9; constexpr long long INF = 1e18; #define all(a) (a).begin(), (a).end() int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; ll n, k, m; vector prime_factorization(ll num){ vector v; for(ll i=2; i*i<=n; i++){ while(num % i == 0){ num /= i; v.emplace_back(i); } } if(num != 1){ v.emplace_back(num); } return v; } vector> num_cnt; int dfs(int idx, ll sum){ if(idx == num_cnt.size()) return 1; ll num, cnt; tie(num, cnt) = num_cnt[idx]; ll cur = 0, base = 1; for(int i=0; i>n>>k>>m; auto v = prime_factorization(n); for(int i=0; i