SHARE
TWEET

lightoj - 1116 - ekka dokka

jakaria_hossain Aug 21st, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fast()(ios_base::sync_with_stdio(false),cin.tie(NULL));
  4. typedef long long ll;
  5. int main()
  6. {
  7.     ll t,w;
  8.     cin>>t;
  9.     for(int i=1; i<=t; i++)
  10.     {
  11.         cin>>w;
  12.         ll even,odd;
  13.         odd=w/2;
  14.         even=2;
  15.         if(w%2!=0)
  16.             cout<<"Case "<<i<<": Impossible"<<endl;
  17.         else
  18.         {
  19.             while(odd%2==0)
  20.             {
  21.                 odd/=2;
  22.                 even*=2;
  23.             }
  24.             cout<<"Case "<<i<<": "<<odd<< " "<<even<<endl;
  25.         }
  26.  
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top