#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long q, n, p[200001], e[200001], x, a, y, b, k;
bool good(long long m) {
  long long res = 0;
  for (long long i = 0; i < m; i++) e[i] = -1;
  long long o = a * b / gcd(a, b), gi = 0;
  for (long long i = o - 1; i < m; i += o) {
    e[i] = p[gi];
    gi++;
  }
  for (long long i = a - 1; i < m; i += a) {
    if (e[i] == -1) {
      e[i] = p[gi];
      gi++;
    }
  }
  for (long long i = b - 1; i < m; i += b) {
    if (e[i] == -1) {
      e[i] = p[gi];
      gi++;
    }
  }
  for (long long i = 0; i < m; i++) {
    if ((i + 1) % a == 0) res += e[i] / 100 * x;
    if ((i + 1) % b == 0) res += e[i] / 100 * y;
  }
  return res >= k;
}
void solve() {
  cin >> q;
  for (long long cq = 0; cq < q; cq++) {
    cin >> n;
    for (long long i = 0; i < n; i++) {
      cin >> p[i];
    }
    cin >> x >> a >> y >> b >> k;
    if (x < y) {
      swap(a, b);
      swap(x, y);
    }
    sort(p, p + n);
    reverse(p, p + n);
    long long l = 0, r = n + 1;
    while (l + 1 < r) {
      long long m = (r + l) / 2;
      if (good(m))
        r = m;
      else
        l = m;
    }
    if (r == n + 1)
      cout << -1 << '\n';
    else
      cout << r << '\n';
  }
}
