#include using namespace std; int main(){ int Q,n,T,u; cin>>Q; while(Q--){ cin>>n>>T; if(T%n){ cout<<"No\n"; continue; } cout<<"Yes\n"; u=T/n; for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ cout<