Advertisement
erfanul007

Light OJ 1116

Dec 31st, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. long long int t,i,x,n,m;
  6. scanf("%lld",&t);
  7. for(i=1;i<=t;i++){
  8. scanf("%lld",&x);
  9. printf("Case %lld: ",i);
  10. if(x%2!=0){
  11. printf("Impossible\n");
  12. continue;
  13. }
  14. m=2;
  15. n=x/2;
  16. while(n%2==0){
  17. m*=2;
  18. n/=2;
  19. }
  20. printf("%lld %lld\n",n,m);
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement