#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
vector<long long> p;
long long x, a, y, b, k;
bool check(long long am) {
  long long tota = 0, totb = 0, totab = 0;
  tota = am / a;
  totb = am / b;
  totab = am / lcm(a, b);
  tota -= totab;
  totb -= totab;
  long long sum = 0, li = totab + tota + totb;
  for (long long i = 0; i < li; i++) {
    long long mx = 0, pick = -1;
    if (totab && p[i] * (x + y) > mx) {
      pick = 0;
      mx = p[i] * (x + y);
    }
    if (tota && p[i] * x > mx) {
      pick = 1;
      mx = p[i] * x;
    }
    if (totb && p[i] * y > mx) {
      pick = 2;
      mx = p[i] * y;
    }
    if (pick == 0)
      totab--;
    else if (pick == 1)
      tota--;
    else
      totb--;
    sum += mx;
  }
  return sum >= k;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q = 0;
  cin >> q;
  while (q--) {
    long long n = 0;
    cin >> n;
    p.resize(n);
    for (long long i = 0; i < n; i++) {
      cin >> p[i];
      p[i] /= 100;
    }
    sort((p).rbegin(), (p).rend());
    cin >> x >> a >> y >> b >> k;
    long long l = 1, r = n;
    if (!check(r)) {
      cout << "-1\n";
      continue;
    }
    while (r - l > 1) {
      long long mid = (r + l) / 2;
      if (check(mid))
        r = mid;
      else
        l = mid;
    }
    cout << (check(l) ? l : r) << endl;
  }
  return 0;
}
