use std::io::Read; fn f(l: &str) { let n: Vec = l.split(' ').flat_map(str::parse).collect(); if n[0] < 1 { println!("{}", if n[1] == 1 { "Yes\n0 0" } else { "No" }) } else if n[1] > n[0] * 4 { println!("No") } else { let t = (n[1] + 3) / 4; let x = (n[0] + 1) / 2 + (t - n[0] % 2) / 2; println!("Yes\n{} {}", x, n[0] - x) } } fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); s.lines().skip(1).for_each(f) }