#include <bits/stdc++.h>
using namespace std;
using namespace std;
map<long long, long long> la;
map<long long, long long> lb;
void label(vector<long long> &arr, long long n, map<long long, long long> &l) {
  for (long long i = 1; i <= n; i++) {
    long long minVal = INT_MAX;
    for (long long j = 0; (j + i) <= n; j++) {
      if (j == 0) {
        minVal = min(arr[i - 1], minVal);
      } else
        minVal = min(minVal, arr[j + i - 1] - arr[j - 1]);
    }
    l[i] = minVal;
  }
}
int32_t main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(m);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  for (long long i = 0; i < m; ++i) cin >> b[i];
  for (long long i = 1; i < n; i++) a[i] += a[i - 1];
  for (long long i = 1; i < m; i++) b[i] += b[i - 1];
  long long x;
  cin >> x;
  label(a, n, la);
  label(b, m, lb);
  long long maxArea = 0;
  for (auto an : la) {
    for (auto bn : lb) {
      if (an.second * bn.second <= x) {
        maxArea = max(maxArea, an.first * bn.first);
      }
    }
  }
  cout << maxArea;
}
