jakaria_hossain

codechef - the tom and jerry game

Jun 11th, 2020
1,413
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 ll long long
  4. #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
  5. int main()
  6. {
  7.     int t;
  8.     cin>>t;
  9.     while(t--)
  10.     {
  11.         ll ts;
  12.         cin>>ts;
  13.         if(ts%2==1)cout<<ts/2<<endl;
  14.         else
  15.         {
  16.             while(ts%2==0)
  17.             {
  18.                 ts/=2;
  19.             }
  20.             cout<<ts/2<<endl;
  21.         }
  22.     }
  23. }
RAW Paste Data