#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
template <typename A, typename B>
ostream &operator<<(ostream &cout, pair<A, B> const &p) {
  return cout << "(" << p.first << ", " << p.second << ")";
}
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v) {
  cout << "[";
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ", ";
    cout << v[i];
  }
  return cout << "]";
}
mt19937 rng(steady_clock::now().time_since_epoch().count());
void usaco(string filename) {
  freopen((filename + ".in").c_str(), "r", stdin);
  freopen((filename + ".out").c_str(), "w", stdout);
}
const long long mod = 1000000007;
long long madd(long long a, long long b) { return (a + b) % mod; }
long long msub(long long a, long long b) {
  return (((a - b) % mod) + mod) % mod;
}
long long mmul(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
long long mpow(long long base, long long exp) {
  long long res = 1;
  while (exp) {
    if (exp % 2 == 1) {
      res = (res * base) % mod;
    }
    exp >>= 1;
    base = (base * base) % mod;
  }
  return res;
}
long long minv(long long base) { return mpow(base, mod - 2); }
long long mdiv(long long a, long long b) { return mmul(a, minv(b)); }
long long gcd(long long x, long long y) {
  if (x == 0) return y;
  if (y == 0) return x;
  return gcd(y, x % y);
}
bool prime[1000006];
void sieve(int n) {
  for (long long i = 0; i < n + 1; i++) prime[i] = 1;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  prime[1] = prime[0] = 0;
}
long long n, m, k, q, Q, T, l, r, x, y, z;
long long ar[500005];
long long b[500005];
string second, t;
long long ans = 0;
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  cin >> Q;
  for (long long q = 0; q < Q; q++) {
    cin >> n;
    for (int ele = 0; ele < n; ele++) cin >> ar[ele];
    ;
    long long a, b;
    cin >> x >> a >> y >> b >> k;
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    sort(ar, ar + n);
    reverse(ar, ar + n);
    int l = 0, r = n;
    long long lcm = a * b / gcd(a, b);
    long long ans = n + 5;
    while (l <= r) {
      long long tot = 0;
      long long m = (l + r) / 2;
      long long cn = m / lcm;
      long long an = m / a - cn;
      long long bn = m / b - cn;
      int pt = 0;
      while (pt < n && cn--) {
        tot += (x + y) * ar[pt] / 100LL;
        pt++;
      }
      while (pt < n && an--) {
        tot += (x)*ar[pt] / 100LL;
        pt++;
      }
      while (pt < n && bn--) {
        tot += (y)*ar[pt] / 100LL;
        pt++;
      }
      if (tot >= k) {
        ans = min(ans, m);
        r = m - 1;
      } else {
        l = m + 1;
      }
    }
    cout << (ans == n + 5 ? -1 : ans) << endl;
  }
}
