DOL - Largest Odd Divisor

no tags 

Given a non-negative integers N. You have to find the largest odd divisor of N.

Input

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).

Output

For each test case print the case number and the largest odd divisor of N.

Sample Input

Output for Sample Input

2
2
10

Case 1: 1
Case 2: 5

Problem Setter: Md Abdul Alim, Dept. of Computer Science, Bangladesh University of Business & Technology


hide comments
sk128: 2021-07-27 18:20:23

O(sqrt(n)) solution will give TLE.
O(log(n)) will be accepted.

Last edit: 2021-07-27 20:10:22
satyam552000: 2021-01-11 05:15:56

there is space between : and 1 in Case 1: 1 :-)

Last edit: 2021-01-11 05:16:23
kumar_anubhav: 2020-06-09 10:54:57

AC in one Go!!!

aj_254: 2019-04-13 23:01:58

very easy ..

prabhav_123: 2019-01-06 23:43:37

never code with your headphones on, I repeat never. Costed me 2 WA's.

n_o_o_b_i_e: 2018-06-13 17:31:41

forgot to write "case " costed WA

terminator222: 2017-06-18 09:29:31

Why is it DOL not LOd :P?

Last edit: 2017-06-18 09:29:46
ayushgupta1997: 2017-05-30 19:36:15

easy :p nothing to cheer!

tomas32: 2017-04-20 17:36:16

care about the output, cost me 10 wa

kira28: 2016-12-31 19:05:43

LOL


Added by:Alim
Date:2015-09-09
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU JS-MONKEY
Resource:Own Problem