#include <bits/stdc++.h>
using namespace std;
int main()
{
long long int l,m,t,w,y,z,h,x,p,q,n;
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
scanf("%lld",&t);
for(l=1;l<=t;l++)
{
cin>>w;
p=0;
for(y=2;y<=w/2;y=y*2)
{
z=y;
n=w/z;
h=w%z;
//cout<<n<<endl;
if(n%2==1 && h==0)
{
m=z;
x=n;
p=1;
break;
}
}
if(p==1)
{
printf("Case %lld: %lld %lld\n",l,x,m);
}
else
{
printf("Case %lld: Impossible\n",l);
}
}
return 0;
}
0 comments:
Post a Comment