Given a non-negative integers N. You have to find an integer P such that, the following conditions should be fulfilled.
1. P must be a divisor of N.
2. If we represent P as a binary number, then the LSB (least significant bit) of P must be 1.
3. P should be as large as possible.
Input starts with an integer T (1 <= T <= 5000) denoting the number of test cases. Each test case contains an integer N (1 <= N <= 1012).
For each test case print the case number and P.
Input | Output |
---|---|
3 2 14 11 | Case 1: 1 Case 2: 7 Case 3: 11 |
This problem was authored for CodeMask Championship 2016 and is being hosted on Toph per organizer’s request.