Introduction to Bit Manipulation
Given a number and a bit position, check, set, and clear that bit.
Input format
A single line with NUM (0 ≤ NUM < 2^40) and POS (0-based bit position, 0 ≤ POS ≤ 40).
Output format
Print three values separated by spaces: the bit of NUM at POS (0 or 1), NUM with that bit set, and NUM with that bit cleared.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
5 1Expected output
0 7 5Example 2
Input
5 0Expected output
1 5 4