本蒟蒻第一次没写出来,看了这篇题解才明白(没脸写题解qwq)
参考这篇文章,写的很好
https://www.luogu.com.cn/article/koqj03r3
C++ 代码
#include <iostream>
#define int long long
using namespace std;
int t;
signed main(){
cin>>t;
while (t--){
int n;
cin>>n;
if (n%3) cout<<n<<endl;
else cout<<n*2<<endl;
}
return 0;
}