#include using namespace std; using ll=long long; using pii=pair; #define all(a) a.begin(),a.end() #define pb push_back #define sz(a) ((int)a.size()) int n,m,w,a[20],b[20]; bool dp[1<<15]; signed main(){ ios_base::sync_with_stdio(0),cin.tie(0); cin >> n >> m >> w; n+=m; for(int i=0; i> a[i]; for(int i=0; i> b[i]; for(int i=0; i> a[n-m+i],a[n-m+i]*=-1; for(int i=0; i> b[n-m+i],b[n-m+i]*=-1; dp[0]=1; int res=0; for(int s=0; s<(1<>i&1) tot+=a[i],val+=b[i]; for(int i=0; i>i&1)) if(tot+a[i]>=0&&tot+a[i]<=w) dp[s^(1<