Make Number Odd
Submissions: 1270   Accuracy:

47.39%

  Difficulty: Easy   Marks: 2

Given a number n. Print the minimum positive integer by which it should be divided so that the result is an odd number.

Input:

First line of the input will contain the number of test cases. 

Each test case will contain a single integer n
 

Output:
Print the required output.

Constraints:

1 <= T <= 100
1 <= N <= 100000

Example:

Input: 
3
36
5
8

Output:
4
1
8

Explanation:

In the first case, 36 must be divided by 4 or 12 to make it odd.
We take minimum of 4 and 12 i.e. 4
In the second case, 5 is already odd.
In the third case, 8 must be divided by 8 to make it an odd number.

** For More Input/Output Examples Use 'Expected Output' option **

Author: jain_rishabh


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.