#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll t, n, i, j=1;
cin >> t;
while(t--)
{
cin >> n;
ll d = n/2, f = 0;
cout << "Case " << j++ << ": ";
for(i=2;i<=d;i=i*2)
{
if(n%i == 0)
{
ll p = n/i;
if(p%2 == 1)
{
f = 1;
cout << p << " " << i << "\n";
break;
}
}
}
if(f == 0)
cout << "Impossible" << "\n";
}
return 0;
}
#define ll long long int
using namespace std;
int main()
{
ll t, n, i, j=1;
cin >> t;
while(t--)
{
cin >> n;
ll d = n/2, f = 0;
cout << "Case " << j++ << ": ";
for(i=2;i<=d;i=i*2)
{
if(n%i == 0)
{
ll p = n/i;
if(p%2 == 1)
{
f = 1;
cout << p << " " << i << "\n";
break;
}
}
}
if(f == 0)
cout << "Impossible" << "\n";
}
return 0;
}
Comments
Post a Comment