307345: CF1343A. Candies
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Candies
题意翻译
对于给定的 $t$ 个 $n$ ,各求出一个正整数 $x$ 使得存在一个 $k>1$ 满足 $x + 2x + 4x + \dots + 2^{k-1}x = n$ 。题目描述
Recently Vova found $ n $ candy wrappers. He remembers that he bought $ x $ candies during the first day, $ 2x $ candies during the second day, $ 4x $ candies during the third day, $ \dots $ , $ 2^{k-1} x $ candies during the $ k $ -th day. But there is an issue: Vova remembers neither $ x $ nor $ k $ but he is sure that $ x $ and $ k $ are positive integers and $ k > 1 $ . Vova will be satisfied if you tell him any positive integer $ x $ so there is an integer $ k>1 $ that $ x + 2x + 4x + \dots + 2^{k-1} x = n $ . It is guaranteed that at least one solution exists. Note that $ k > 1 $ . You have to answer $ t $ independent test cases.输入输出格式
输入格式
The first line of the input contains one integer $ t $ ( $ 1 \le t \le 10^4 $ ) — the number of test cases. Then $ t $ test cases follow. The only line of the test case contains one integer $ n $ ( $ 3 \le n \le 10^9 $ ) — the number of candy wrappers Vova found. It is guaranteed that there is some positive integer $ x $ and integer $ k>1 $ that $ x + 2x + 4x + \dots + 2^{k-1} x = n $ .
输出格式
Print one integer — any positive integer value of $x$ so there is an integer $k>1$ that $x+2x+4x+⋯+2^{k-1}x=n$.
输入输出样例
输入样例 #1
7
3
6
7
21
28
999999999
999999984
输出样例 #1
1
2
1
7
4
333333333
333333328