1116 - Ekka Dokka
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
for(int cs = 1; cs <= t; cs++){
long long w;
cin >> w;
if(w&1){
cout << "Case "<< cs<<": Impossible\n";
}
else{
for(long long i = 2; i <= w; i+=2){
long long x = w/i;
if(x&1 && (x*i) == w){
cout << "Case "<<cs<< ": "<<x<<" "<<i<<endl;
break;
}
}
}
}
return 0;
}
No comments:
Post a Comment