10742 - Bit setting   

Description

Given an input number N and a control signal M, convert N to 4-bit unsigned binary representation. If the M th bit is 0, set it to 1, otherwise set it to 0. 

Hints

(0 + 1) % 2 -> 1

(1 + 1) % 2 -> 0

0 ^ 1 -> 1

1 ^ 1 -> 0

Input

The input consists of two integers, N, M. (0 <= N <= 15, 1 <= M <= 4)

Output

The value after setting the M th bit and the 4-bit binary representation of the value.

Note that you do not need to print ‘\n’ at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss