Given set S={1, 2, 3,..., N}. Find two integers, A and B (where A
#!/bin/python3 import math import os import random import re import sys T = int(input().strip()) for _ in range(T): n , k = map(int , input().split()) print(k-1 if ((k-1) | k) <= n else k-2)