ProgMe

Untitled

Apr 21st, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define int int64_t
  3. #define double long double
  4. #define F first
  5. #define S second
  6. #define pb push_back
  7. #define pf push_front
  8. #define ppb pop_back();
  9. #define ppf pop_front();
  10. #define For(n) for (int i = 0; i < n; i++)
  11. #define FOR(i, n) for (i; i < n; i++)
  12. #define optimization ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  13.  
  14. using namespace std;
  15. typedef pair <int, int> pii;
  16. typedef deque <int> di;
  17.  
  18. int binpow(int x, int y)
  19. {
  20. if (y == 0)
  21. return 1;
  22. if (y & 1)
  23. return binpow(x, y - 1) * x;
  24. else
  25. {
  26. int ans = binpow(x, y / 2);
  27. return ans * ans;
  28. }
  29. }
  30.  
  31. int32_t main()
  32. {
  33. int t;
  34. cin >> t;
  35. while (t--)
  36. {
  37. int n;
  38. cin >> n;
  39. int sum = 3, prsum = 4;
  40. while (n % sum)
  41. {
  42. sum += prsum;
  43. prsum *= 2;
  44. }
  45. cout << n / sum << "\n";
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment