for _ in range(int(input())): N,K=map(int,input().split()) b1=False while K