Maximize OR
Submissions: 467   Accuracy:

20.32%

  Difficulty: Basic   Marks: 1

Given a number X find the total numbers A such that

A OR X > X,  and

1<=A<=X.

Input:
The first line contains an integer T denoting number of testcases. The following T lines contains an integer X each.


Output:
Print the total count of the different value of A possible. 

Constraints:

1<=T<=10^5
1<=X<=10^8

Example:
Input
2
10
5
Output
7
2

Explanation:
In the range [1,10] if the OR is taken of 10 and any number in the set {1,3,4,5,6,7,9} the resulting value will be greater than 10.

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

Contributor: ShivamKD
Author: support3


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.