#include int main(void){ int q;std::cin>>q; while(q--){ int d,k; std::cin>>d>>k; int x = d/2,y = d-y; while(true){ if(x*2==d || x==0){ k -= 4; } else { k -= 8; } if(k<=0){ break; } x-=1;y+=1; } if(x<0||y>d){ std::cout << "No" << std::endl; } else{ std::cout << x << " " << y << std::endl; } } }