OJ-Problems-Source/HDOJ/1339_autoAC.cpp

20 lines
324 B
C++
Raw Normal View History

2016-08-13 23:51:27 +08:00
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int t,n,q;
cin>>t;
while(t--)
{
cin>>n;
for(int p=0;p<=log(n)+1;p++)
{
q=1<<p;
if(n%q==0&&((n/q)&1))
cout<<n/q<<" "<<p<<endl;
}
}
return 0;
}