#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll LCM(ll a, ll b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  ll product = a * b;
  while (a % b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return product / b;
}
ll sum(multiset<ll> &p, ll lcm, ll a, ll x, ll b, ll y, int n) {
  ll sum = 0;
  auto it = p.rbegin();
  for (int i = 1; i * lcm <= n; ++i) sum += *(it++) * (x + y) / 100;
  for (int i = 1; i * a <= n; ++i)
    if (i * a % lcm != 0) sum += *(it++) * x / 100;
  for (int i = 1; i * b <= n; ++i)
    if (i * b % lcm != 0) sum += *(it++) * y / 100;
  return sum;
}
int main() {
  int q = 0;
  cin >> q;
  for (int i = 0; i < q; ++i) {
    int n = 0;
    cin >> n;
    multiset<ll> p;
    for (int j = 0; j < n; ++j) {
      ll buf = 0;
      cin >> buf;
      p.insert(buf);
    }
    ll a = 0, x = 0, b = 0, y = 0;
    cin >> x >> a >> y >> b;
    ll k = 0;
    cin >> k;
    ll lcm = LCM(a, b);
    if (x < y) swap(x, y), swap(a, b);
    if (sum(p, lcm, a, x, b, y, n) < k) {
      cout << "-1\n";
      continue;
    }
    int l = 0, r = n;
    while (r - l > 1) {
      int m = (l + r) / 2;
      if (sum(p, lcm, a, x, b, y, m) < k)
        l = m;
      else
        r = m;
    }
    cout << r << "\n";
  }
  return 0;
}
