#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3, INF = 1e9;
long long fun(long long n, vector<long long> &v, long long x, long long a,
              long long y, long long b, long long nok) {
  long long ans = 0;
  int nokc = n / nok, xc = n / a - nokc, yc = n / b - nokc, i = 0;
  for (int j = 0; j < nokc; ++j) ans += v[i] / 100 * (x + y), i++;
  for (int j = 0; j < xc; ++j) ans += v[i] / 100 * x, i++;
  for (int j = 0; j < yc; ++j) ans += v[i] / 100 * y, i++;
  return ans;
}
long long gcd(long long a, long long b) {
  while (b) a %= b, swap(a, b);
  return a;
}
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int q;
  cin >> q;
  for (int z = 0; z < q; ++z) {
    long long n, x, a, y, b, nok, k;
    cin >> n;
    vector<long long> v(n);
    for (auto &t : v) cin >> t;
    cin >> x >> a >> y >> b >> k;
    nok = (a * b) / gcd(a, b);
    if (x < y) swap(x, y), swap(a, b);
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    long long l = 1, r = n, m;
    while (l < r) {
      m = (l + r) / 2;
      if (fun(m, v, x, a, y, b, nok) < k)
        l = m + 1;
      else
        r = m;
    }
    if (fun(l, v, x, a, y, b, nok) < k) {
      cout << -1 << endl;
      continue;
    }
    cout << l << endl;
  }
  return 0;
}
