-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Candies.cpp
More file actions
34 lines (34 loc) · 739 Bytes
/
A_Candies.cpp
File metadata and controls
34 lines (34 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 100000005;
vector<bool> p(MAXN, false);
vector<ll> prime;
#define fastio \
{ \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
}
int main()
{
fastio
ll t,
c = 0;
cin >> t;
ll arr[32];
for (ll i = 1; i < 32; i++)
arr[i] = pow(2, i + 1) - 1;
while (t--)
{
c = 0;
ll n;
cin >> n;
for (ll i = 1; i < 32; i++)
if (n % arr[i] == 0)
{
cout << n / arr[i] << endl;
c = 1;
break;
}
}
}