T1 他的世界
解题思路
“暴力也能过”
code
#include<iostream>
#include<cstdio>
using namespace std;
int T;
int n,m;
int main()
{
freopen("number.in","r",stdin);
freopen("number.out","w",stdout);
cin>>T;
while(T--)
{
scanf("%d%d",&n,&m);
while(m)
{
int s[3]={},t=n;
while(t) s[t%3]++,t/=3;
if(s[1]==s[2])
printf("%lld ",n),m--;
n++;
}
printf("\n");
}
}