#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> T; while(T--){ ll N; cin >> N; ll r; for(i=0;i<50;i++){ if(a[i]>N){ r=i; break; } } ll ans=0; for(i=1;i<=r;i++){ ll n=N; ll x=n/a[i],y=n%a[i]; ans+=a[i]/2*x+max(0LL,y-a[i-1]+1); } cout << ans << endl; } return 0; }