jakaria_hossain

codeforce - candies.cpp

Apr 22nd, 2020
315
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.     fast();
  8.     ll t;
  9.     cin>>t;
  10.     while(t--)
  11.     {
  12.         ll n;
  13.         cin>>n;
  14.         ll sum=1,i=1,x;
  15.         while(sum<=n)
  16.         {
  17.             if(n%sum==0)
  18.             {
  19.                 x=n/sum;
  20.                // cout<<"X "<<x<<" "<<sum<<endl;
  21.             }
  22.             i*=2;
  23.             sum+=i;
  24.         }
  25.         cout<<x<<endl;
  26.     }
  27. }
RAW Paste Data