import sys # sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd def sol(): d,k = map(int,input().split()) if d == 0: if k == 1: print('Yes') print(0,0) else: print('No') elif k > d*4: print('No') else: print('Yes') if k <= (d-1)*4: print(d//2,int(d/2+0.5)) else: print(0,d) T = int(input()) for i in range(T): sol()