Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define int int64_t
- #define double long double
- #define F first
- #define S second
- #define pb push_back
- #define pf push_front
- #define ppb pop_back();
- #define ppf pop_front();
- #define For(n) for (int i = 0; i < n; i++)
- #define FOR(i, n) for (i; i < n; i++)
- #define optimization ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
- using namespace std;
- typedef pair <int, int> pii;
- typedef deque <int> di;
- int binpow(int x, int y)
- {
- if (y == 0)
- return 1;
- if (y & 1)
- return binpow(x, y - 1) * x;
- else
- {
- int ans = binpow(x, y / 2);
- return ans * ans;
- }
- }
- int32_t main()
- {
- int t;
- cin >> t;
- while (t--)
- {
- int n;
- cin >> n;
- int sum = 3, prsum = 4;
- while (n % sum)
- {
- sum += prsum;
- prsum *= 2;
- }
- cout << n / sum << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment