Last active
February 12, 2016 16:37
-
-
Save Nahiduzzaman/88d473ef39fcdb8eebbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int t,i=0; | |
unsigned long long int w; | |
scanf("%llu",&t); | |
//for(int i = 0 ; i < t;i++) | |
while(t--) | |
{ | |
scanf("%llu",&w); | |
unsigned long long int odd = 1, even = 2; | |
if(w%2 == 0) | |
{ | |
while(w != even*odd){ | |
if(w%even == 0){ | |
odd = w/even; | |
if(odd%2 == 0) | |
{ | |
even += 2; | |
} | |
} | |
else { | |
even += 2; | |
} | |
} | |
printf("Case %d: %llu %llu\n",i+1, odd, even); | |
} | |
else | |
{ | |
printf("Case %d: Impossible\n",i+1); | |
} | |
i++; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment