#include #include #include #include using namespace std; typedef unsigned long long ll; ll tot=0; set s; void pri(ll h) { if (h%2==0) { s.insert(2); } while(h % 2==0){ h=h/2; } for (ll i=3;i<=sqrt(h);i+=2) { while (h%i==0) { s.insert(i); h= h/i; } } if (h>2) s.insert(h); } int main(){ ll num; cin>>num; while(num--){ ll rum=0; ll anser,orig; cin>>anser; orig=anser; pri(anser); for(auto it=s.rbegin();it!=s.rend();it++){ while( anser % (*it) == 0 ) { rum=rum+orig/anser; anser=anser/(*it); } } rum=rum+orig; tot+=rum; } cout<