A题

#include<bits/stdc++.h>
using namespace std;

const int maxn = 110;
int t,a[maxn],n,x,sum,f;

void solve()
{
    cin>>n>>x;
    sum = 0,f = 0;
    for(int i = 1;i <= n; ++i)
    {
        cin>>a[i];
        sum += a[i];
        if(f)
        {
            swap(a[i],a[i - 1]);
            f = 0;
        }
        if(sum == x) f = 1;
    }
    if(f) printf("NO\n");
    else
    {
        printf("YES\n");
        for(int i = 1;i <= n; ++i) printf("%d%c",a[i]," \n"[i == n]);
    }
}

int main()
{
    std::ios::sync_with_stdio(false);
    cin>>t;
    while(t--) solve();
    return 0;
}