Max And

5

1 votes
Easy
Problem

Two boys Aniket and Harsh are at war over a girl, Shaalu. Driven by their feelings, they decided to confess to her. Since both of them were equally dumb, Shaalu decided that she would go out with that boy who would help her with her homework and thus prove that he is less dumb.

Given two numbers A and B. Find the value of AND of pair (P,Q) such that,

A <= P < Q <= B

value of P AND Q is maximum where AND is a binary operator. you will have to print that maximum possible value of P & Q.

NOTE: Refer to this link for more information about AND operator : http://en.wikipedia.org/wiki/Bitwise_operation#AND

 

INPUT

The first line will contain t number of test cases.

Next t lines will contain t lines of input each line will contain two numbers A and B.

OUTPUT

For each testcase print single integer as answer.

 

CONSTRAINTS

1<=T<=1000
1<= A < B <=1018

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?