BETA

Difficulty Level: Basic

Submissions: 2298 Accuracy:

41.6%

Replace the Bit
       

Given two numbers n and k, change the kth bit of the number n to '0' if it is  '1', else return the number n itself.

Input:
First line of the input contains an intger T denoting the number of test case. Each test contains a single line containg two space seperated integers n and k respectively.

Output:
For each test case output a single integer.

Constraints:
1<=T<=100
1<=N<=106

Example:
Input:
2
13 3
13 2
Output:
13
9

Explanation:

Test Case 1: n = 13 ('1101') k=3
return 13

Test Case 2: n = 13('1101') k=2
return 9('1001')

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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