Count of pairs having bit size at most X and Bitwise OR equal to X
Given a number X, calculate number of possible pairs (a, b) such that bitwise or of a and b is equal to X and number of bits in both a and b is less than equal to number of bits in X. Examples: Input: X = 6 Output: 9 Explanation: The possible pairs of (a, b) are (4, 6), (6, 4), (6, 6), (6, 2), (4, 2