// #define _GLIBCXX_DEBUG #include using namespace std; #include using namespace atcoder; using ll = long long; #define rep(i,n) for (ll i = 0; i < (n); ++i) using vl = vector; using vvl = vector; using P = pair; #define pb push_back #define int long long #define double long double #define INF (ll) 3e18 // Ctrl + Shift + B コンパイル // Ctrl + C 中断 // ./m 実行 signed main(){ int n, m, w; cin >> n >> m >> w; vl a(n); vl b(n); vl c(m); vl d(m); rep(i,n) cin >> a[i]; rep(i,n) cin >> b[i]; rep(i,m) cin >> c[i]; rep(i,m) cin >> d[i]; int bitsize = (1LL << (n+m)); vector

dp(bitsize, P(-INF, -INF)); dp[0] = P(0,0); rep(i, bitsize){ rep(j, n+m){ if (i & (1<= 0) { dp[i|(1<