#include <bits/stdc++.h>
using namespace std;
vector<bool> used;
bool check(vector<long long> z, vector<long long> a, long long n, long long k,
           long long x, long long y, long long s, long long u) {
  long long h = 0;
  for (long long j = 0; j < n; ++j) {
    if (z[j] == (x + y) && !used[j]) {
      used[j] = true;
      ++u;
      s += (x + y) * (a[a.size() - 1]);
      a.erase(a.begin() + a.size() - 1);
      if (s >= k) {
        return true;
        h = 1;
        break;
      }
    }
  }
  for (long long j = 0; j < n; ++j) {
    if (h == 1) {
      break;
    }
    if (z[j] == max(x, y) && !used[j]) {
      used[j] = true;
      ++u;
      s += max(x, y) * (a[a.size() - 1]);
      a.erase(a.begin() + a.size() - 1);
      if (s >= k) {
        return true;
        h = 1;
        break;
      }
    }
  }
  for (long long j = 0; j < n; ++j) {
    if (h == 1) {
      break;
    }
    if (z[j] == min(x, y) && !used[j]) {
      used[j] = true;
      ++u;
      s += min(x, y) * (a[a.size() - 1]);
      a.erase(a.begin() + a.size() - 1);
      if (s >= k) {
        return true;
        h = 1;
        break;
      }
    }
  }
  if (h == 0) {
    return false;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  long long n;
  vector<long long> a;
  long long x, y;
  long long v, c, d, k;
  vector<long long> z;
  long long s;
  long long u;
  long long h;
  long long low, up;
  long long o;
  for (long long i = 0; i < q; ++i) {
    h = 0;
    u = 0;
    s = 0;
    cin >> n;
    a.clear();
    a.resize(n);
    used.resize(n);
    z.resize(n);
    for (long long j = 0; j < n; ++j) {
      cin >> x;
      a[j] = x / 100;
      z[j] = 0;
      used[j] = false;
    }
    cin >> x >> c >> y >> d >> k;
    sort(a.begin(), a.end());
    for (long long j = 1; (c * j) <= n; ++j) {
      z[c * j - 1] += x;
    }
    for (long long j = 1; (d * j) <= n; ++j) {
      z[d * j - 1] += y;
    }
    low = 0;
    up = n;
    if (!check(z, a, n, k, x, y, s, u)) {
      cout << (-1) << endl;
      continue;
    }
    while (true) {
      for (long long j = 0; j < n; ++j) {
        used[j] = false;
      }
      if ((up - low) == 1) {
        cout << up << endl;
        break;
      }
      o = (up + low) / 2;
      if (!check(z, a, o, k, x, y, s, u)) {
        low = o;
      } else {
        up = o;
      }
    }
  }
  return 0;
}
