#include using namespace std; using Int = long long; template void chmin(T &a,T b){if(a>b) a=b;} template void chmax(T &a,T b){if(a>n; vector v(n); for(Int i=0;i>v[i]; Int ans=0; map dp; vector x; function dfs=[&](Int s){ if(dp.count(s)) return dp[s]; dp[s]=1; Int &res=dp[s]; for(Int i=0;i<(Int)x.size();i++){ if(x[i]>=s) break; if(s%x[i]) continue; chmax(res,(s/x[i])*dfs(x[i])+1LL); } //cout<