#include using namespace std; #define Long long long #define PB push_back map mymap; vector vec; Long DP[1000009]; Long IND = 0; Long GET(Long n, Long siz) { IND++; if(n<=1000000) return DP[n]; if(mymap.find(n) != mymap.end()) return mymap[n]; Long i,j,k,l,ans = 1; for(i=1; in) break; if(n%vec[i]==0) ans = max(ans, 1 + vec[i] * GET(n/vec[i], siz)); } mymap[n] = ans; return ans; } int main() { Long i,j,k,l,n,m,ans=0,test; DP[1] = 1; for(i=2;i<=1000000;i++) { DP[i] = max(DP[i], i+1); for(j=i*2;j<=1000000;j+=i) { DP[j] = max(DP[j], 1 + DP[i] * j/i); } } ans = 0; cin>>test; while(test--) { cin>>n; vec.clear(); for(i=1; i*i