#include using namespace std; using ll=long long; int main(){ ll n,m,w; cin>>n>>m>>w; vector a(n),b(n),c(m),d(m); for(ll i=0;i>a[i]; } for(ll i=0;i>b[i]; } for(ll i=0;i>c[i]; } for(ll i=0;i>d[i]; } ll dp[1<<(n+m)][w+1]; for(ll i=0;i<(1<<(n+m));i++){ for(ll j=0;j<=w;j++){ dp[i][j]=0; } } for(ll s=0;s<(1<<(n+m));s++){ for(ll i=0;i=0){ dp[s|(1<