#include <bits/stdc++.h>

using namespace std;

int main()

{

int tc;

cin>>tc;

for(int i=1;i<=tc;i++)

{

```
long long int n;
cin>>n;
long long int a[n+1];
a[0] = 0;
for(long long int j =1;j<=n;j++)
{
a[j] = max(j,a[j/2] + a[j/3] + a[j/4]);
}
cout<<a[n]<<endl;
}
```

}

/* Can anyone tell me what is wrong with this solution */