Product of and Door

3.4

12 votes
Problem

Heading ##There are two integers A and B. You are required to compute the bitwise AND amongst all natural numbers lying between A and B, both inclusive.

Input Format

First line of the input contains T, the number of testcases to follow. Each testcase in a newline contains A and B separated by a single space.

Constraints

1≤T≤200

0≤A≤B<232

Output Format

Output one line per test case with the required bitwise AND.

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

1st Test Case : 12 & 13 & 14 & 15 = 12

2nd Test Case : 2 & 3 = 2

3rd Test Case : 8 & 9 & 10 & 11 & 12 & 13 = 8

Editor Image

?