NO CHANGE REQUIRED :EASY CODE EDITORIAL

#include <bits/stdc++.h>
using namespace std;
int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int n,p;
	    cin>>n>>p;
	    int arr[n];
	    int flag=0,index=-1;
	    for(int i=0;i<n;i++){
	        cin>>arr[i];
	        if(p%arr[i]!=0){
	            flag=1;
	            index=i;
	        }
	    }
	    
	    if(flag==1){
	        cout<<"YES"<<" ";
	        int num=p/arr[index]+1;
	        for(int i=0;i<n;i++){
	            if(i==index){
	                cout<<num<<" ";
	            }
	            else
	            cout<<0<<" ";
	        }
	        cout<<endl;
	        
	    }
	    else{
	        int f=0,ind1=-1,ind2=-1;
	        for(int i=0;i<n;i++){
	            for(int j=i+1;j<n;j++){
	                if(arr[i]>arr[j] && arr[i]%arr[j]!=0){
	                    f=1;
	                    ind1=i;
	                    ind2=j;
	                    break;
	                }
	                else if(arr[i]<arr[j] && arr[j]%arr[i]!=0){
	                    f=1;
	                    ind1=i;
	                    ind2=j;
	                    break;
	            }
	        }
	        if(f==1)
	        break;
	        }
	        
	        if(f==1){
	            cout<<"YES"<<" ";
	            int num1,num2;
	            if(arr[ind1]>arr[ind2]){
	             num1=p/arr[ind1] -1 ;
	             num2=((p-(arr[ind1]*num1))/arr[ind2] )+1;
	            }
	            else{
	                 num2=p/arr[ind2] -1 ;
	             num1=((p-(arr[ind2]*num2))/arr[ind1] )+1;
	                
	            }
	            
	            for(int i=0;i<n;i++){
	                if(i==ind1){
	                    cout<<num1<<" ";
	                }
	                else if(i==ind2)
	                cout<<num2<<" ";
	                else
	                cout<<0<<" ";
	            }
	           cout<<endl;
	        }
	        else
	        cout<<"NO"<<endl;
	    }
	}
	return 0;
}