#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1000000000;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
struct IOSetup {
  IOSetup() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(12);
  }
} iosetup;
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << p.first << " " << p.second;
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (int i = 0; i < (int)v.size(); i++)
    os << v[i] << (i + 1 == (int)v.size() ? "" : " ");
  return os;
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &x : v) is >> x;
  return is;
}
void solve() {
  int n;
  cin >> n;
  vector<ll> p(n);
  cin >> p;
  ll x, a, y, b;
  cin >> x >> a >> y >> b;
  if (x < y) swap(x, y), swap(a, b);
  ll k;
  cin >> k;
  sort(p.begin(), p.end());
  reverse(p.begin(), p.end());
  auto f = [&](int m) {
    int both = 0, cnta = 0, cntb = 0;
    for (int i = 1; i <= m; i++) {
      if (i % a == 0 and i % b == 0)
        both++;
      else if (i % a == 0)
        cnta++;
      else if (i % b == 0)
        cntb++;
    }
    ll res = 0;
    for (int i = 0; i < (m); i++) {
      if (both)
        res += p[i] / 100 * (x + y), both--;
      else if (cnta)
        res += p[i] / 100 * (x), cnta--;
      else if (cntb)
        res += p[i] / 100 * (y), cntb--;
    }
    return res >= k;
  };
  int lw = 1, hi = n, res = -1;
  while (lw <= hi) {
    int mid = (lw + hi) / 2;
    if (f(mid)) {
      res = mid;
      hi = mid - 1;
    } else {
      lw = mid + 1;
    }
  }
  cout << res << endl;
}
signed main() {
  int q;
  cin >> q;
  while (q--) solve();
  return 0;
}
