先看数据
对于 的数据,,。
一道标准的构造题,通过数据,我们不难发现这题只能容忍 或 的复杂度,通过暴力打出答案我们不难发现,一定有一组数据 ,。
研究暴力出的所有答案,我们发现一定有一组符合上述条件的数据,其 为 , 是 的因数。
上代码
#include<bits/stdc++.h>
using namespace std;
int t,a,temp;
int main()
{
cin>>t;
for(int i=1;i<=t;i++)
{
cin>>a;
temp=a;
int cnt=2;
while(temp%2==0)//得出2^x的值
{
cnt*=2;
temp/=2;
}
cout<<1<<' '<<cnt<<' '<<cnt+a<<endl;
}
return 0;
}