#include <bits/stdc++.h>
using namespace std;
const int64_t Nmax = 2e5 + 10;
const int64_t mod = 1000000007;
vector<int64_t> prime;
int64_t is_power_of_two(int64_t a) { return a && (!(a & (a - 1))); }
int64_t isperfectsquare(int64_t a) {
  double b = sqrt(a);
  return (b - ceil(b) == 0);
}
int64_t pow(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  int64_t res = 1;
  while (b > 0) {
    if (b & 1) {
      res = res * a % m;
    }
    a = a * a % m;
    b = b / 2;
  }
  return res;
}
int64_t mod_add(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (((a + b) % m) + m) % m;
}
int64_t mod_mul(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (((a * b) % m) + m) % m;
}
int64_t mod_sub(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (((a - b) % m) + m) % m;
}
int64_t mod_div(int64_t a, int64_t b, int64_t m) {
  a = a % m;
  b = b % m;
  return (mod_mul(a, pow(b, m - 2, m), m));
}
void seive(int64_t n) {
  bool isprime[n];
  memset(isprime, true, sizeof(isprime));
  prime.push_back(2);
  for (int64_t i = 3; i <= sqrt(n); i += 2) {
    if (isprime[i]) {
      for (int64_t j = i * i; j <= n; j += i) {
        isprime[j] = false;
      }
    }
  }
  for (int64_t i = 3; i <= n; i += 2) {
    if (isprime[i]) {
      prime.push_back(i);
    }
  }
}
int64_t p, p1, q, q1;
int64_t a[Nmax];
int64_t value(int64_t n) {
  set<int64_t> mset;
  for (int64_t i = p1; i <= n; i += p1) {
    mset.insert(i);
  }
  for (int64_t i = q1; i <= n; i += q1) {
    mset.insert(i);
  }
  vector<int64_t> c;
  for (auto &e : mset) {
    if (e % p1 == 0 && e % q1 == 0) {
      c.push_back(q + p);
    } else if (e % p1 == 0) {
      c.push_back(p);
    } else {
      c.push_back(q);
    }
  }
  int64_t res = 0;
  sort(c.rbegin(), c.rend());
  for (int64_t i = 0; i < c.size(); i++) {
    res += (a[i] / 100) * c[i];
  }
  return res;
}
void solve() {
  int64_t n, ans = -1, tot;
  cin >> n;
  for (int64_t i = 0; i < n; i++) {
    cin >> a[i];
  };
  sort(a, a + n, greater<int64_t>());
  cin >> p >> p1 >> q >> q1;
  cin >> tot;
  int64_t l = 0, r = n + 1;
  while (l <= r) {
    int64_t mid = (l + r) / 2;
    if (value(mid) >= tot) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
