题目链接:https://codeforces.com/contest/1343/problem/A
签到题,for循环暴力枚举即可。
代码如下:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n;
scanf("%d", &n);
for(int i = 4; i <= n + 1; i *= 2) {
if(n % (i - 1) == 0) {
printf("%d\n", n / (i - 1));
break;
}
}
}
return 0;
}