#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  for (long long _ = 0; _ < q; ++_) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    for (long long i = 0; i < n; ++i) {
      cin >> a[i];
      a[i] /= 100ll;
    }
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    long long a1, x;
    cin >> x >> a1;
    long long b, y;
    cin >> y >> b;
    if (x < y) {
      swap(x, y);
      swap(a1, b);
    }
    long long k;
    cin >> k;
    long long l = 0ll;
    long long r = n + 1ll;
    while (r - l > 1ll) {
      long long m = (l + r) / 2ll;
      long long c1 = m / (a1 * b / gcd(a1, b));
      long long c2 = m / a1 - c1;
      long long c3 = m / b - c1;
      long long cur = 0;
      for (long long i = 0; i < c1; ++i) {
        cur += a[i] * (x + y);
      }
      for (long long i = c1; i < c1 + c2; ++i) {
        cur += a[i] * x;
      }
      for (long long i = c1 + c2; i < c1 + c2 + c3; ++i) {
        cur += a[i] * y;
      }
      if (cur >= k) {
        r = m;
      } else {
        l = m;
      }
    }
    if (r == n + 1ll) {
      cout << -1 << endl;
    } else {
      cout << r << endl;
    }
  }
  return 0;
}
