#include using namespace std; #define pb push_back #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define sz size() #define forn(i,m) for(int i=0;i<(int)(m);i++) #define fornn(i,n,m) for(int i=n;i<(int)(m);i++) #define forb(i,n,m) for(int i=n;i>=(int)(m);i--) #define forit(it,c) for(__typeof(c.begin()) it=c.begin();it!=c.end();++it) #define mem(a,b) memset(a,b,sizeof(a)) #define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr) #define pw(x) (1LL<<(x)) #define DBGV(vari) cerr << #vari<< " = "<< (vari) < pii; typedef vector vpii; typedef vector vs; typedef vector vi; typedef vector vd; typedef vector > vvi; typedef long long ll; typedef long double ld; typedef vector vll; typedef pair pdd; typedef pair pll; typedef vector vpll; typedef vector vvpll; inline int nextint(){ int x; scanf("%d",&x); return x; } inline ll nextll() { ll x; scanf("%lld",&x); return x; } #define gc getchar template void scanint(T &x) { T c = gc(); while(((c < 48) || (c > 57)) && (c!='-')) c = gc(); bool neg = false; if(c == '-') {neg = true; c = gc();} x = 0; for(;c < 48 || c > 57;c=gc()); for(;c > 47 && c < 58;c=gc()) x = (x*10) + (c - 48); if(neg) x = -x; } // variadics templateT min_ ( T a , T b ) { return a > b ? b : a ; } template < typename T , typename... Ts > T min_( T first , Ts... last ){ return min_(first, min_(last...)); } templateT max_ ( T a , T b ) { return a > b ? b : a ; } template < typename T , typename... Ts > T max_( T first , Ts... last ){ return max_(first, max_(last...)); } // lambda exp auto square = [](int inp) { return inp * inp; } ; template std::ostream& operator<<(std::ostream &os, const std::pair &t) { os<<"("< ostream& operator<< (ostream& out, const vector& v) { out << "["; size_t last = v.size() - 1; for(size_t i = 0; i < v.size(); ++i) { out << v[i]; if (i != last) out << ", "; } out << "]"; return out; } template ostream& operator<< (ostream& out, const set& v) { out << "{"; auto last = v.end(); for(auto i = v.begin(); i != last;) { out << *i; if (++i != last) out << ", "; } out << "}"; return out; } template ostream& operator<< (ostream& out, const map& v) { out << "{"; auto last = v.end(); for(auto i = v.begin(); i != last;) { out << *i; if (++i != last) out << ", "; } out << "}"; return out; } template void trace(std::ostream& out, Arg&& arg, Args&&... args) { out<<"<< "; out << std::forward(arg); using expander = int[]; (void)expander{0, (void(out << ", " << std::forward(args)),0)...}; out<<" >>\n"; } ll pwr(ll base, ll p, ll mod){ ll ans = 1; while(p) { if(p&1) ans=(ans*base)%mod; base=(base*base)%mod; p/=2; } return ans; } ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b,a%b); } ll lcm(ll a, ll b) { return a*(b/gcd(a,b)); } const long double PI = (long double)(3.1415926535897932384626433832795); const ll mx_ll = numeric_limits :: max(); const int mx_int = numeric_limits :: max(); const int mod = 1e9+7; const int oo = 0x3f3f3f3f; const ll OO = 0x3f3f3f3f3f3f3f3fll; const double eps = 1e-9; const int dx[8]={0,1, 0,-1,-1,1,-1, 1}; const int dy[8]={1,0,-1, 0,-1,1, 1,-1}; const int dsx[4]={0,1, 0,-1}; const int dsy[4]={1,0,-1, 0}; /*************************************************************************/ const int maxn=2000123; const ll bign=maxn * 1LL * maxn; int n; ll a[120]; int prime[maxn]; vi primes; ll ans=0; map vis; map dp; void sieve(){ mem(prime,-1); for(int i=2;i>n; forn(i,n) cin>>a[i]; dp[1]=1; vis[1]++; } map getPfacts(ll x){ map facts; int pind=0; while(x>1 and pind1) facts[x]++; return facts; } ll solve(ll x){ if(x==1) return 1; map pfacts = getPfacts(x); ll part=1; for(const auto& fact: pfacts){ //debug3(x, fact.first,fact.second); forn(i,fact.second){ part = part*fact.first + 1; } } return part; /*pnum = getLargestDiv(x); if(x%pnum == 0){ return 1 + x/pnum * solve(pnum); } dp[x]=x+1;*/ //return x+1; } void _solve(){ //forn(i,30) debug(primes[i]); forn(i,n){ ans += solve(a[i]); } cout<>qq; while(qq--){ _input(); _solve(); } } /*************************************************************************/