#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int inf=1<<30; const ll INF=1LL<<62; typedef pair P; typedef pair PP; const ll MOD=998244353; const int MAXN=3*1000000; ll solve(){ ll N; cin>>N; N++; ll ans=0; for(int k=0;k<60;k++){ ll c=N/(1LL<<(k+1)); ans+=c*(1LL<>T; vector ans(T); for(int t=0;t