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

typedef long long ll;
const int maxn=100;
int n,c;
ll w;
ll a[maxn],b[maxn];

bool dfs( int u )
{
	if( u==n ) return true;
	for( int i=0;i<min(c,u+1);i++ )
	{
		if( b[i]+a[u]<=w )
		{
			b[i]+=a[u];
			if( dfs(u+1) ) return true;
			b[i]-=a[u];
		}
	}
	return false;
} 

void solve()
{
	cin>>n>>c>>w;
	memset(b,0,sizeof(b));
	for( int i=0;i<n;i++ ) cin>>a[i];
	if( dfs(0) ) puts("Yes");
	else puts("No");
}

int main()
{
	int t;
	cin>>t;
	while( t-- ) solve();
	return 0;
}

C题dfs搜 能过 是数据的锅吗