#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e10;
const long long minf = -1e10;
long long t;
long long n, p[200005], x, a, y, b, k;
long long add[200005], total;
void readfile() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("test"
            ".inp",
            "r")) {
    freopen(
        "test"
        ".inp",
        "r", stdin);
  }
  cin >> t;
}
bool ok(long long tic) {
  for (long long i = 1; i <= tic; i++) {
    add[i] = 0;
    if (i % a == 0) add[i] += x;
    if (i % b == 0) add[i] += y;
  }
  priority_queue<long long> q1;
  priority_queue<long long> q2;
  for (long long i = 1; i <= n; i++) {
    if (i <= tic && add[i]) q1.push(add[i]);
    q2.push(p[i]);
  }
  total = 0;
  while (q1.size()) {
    long long u = q1.top();
    long long v = q2.top();
    q1.pop();
    q2.pop();
    total += (v / 100) * u;
  }
  return total >= k;
}
void solve() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> p[i];
  }
  cin >> x >> a >> y >> b >> k;
  long long l = 1, r = n + 1;
  while (r - l > 0) {
    long long mid = (l + r) / 2;
    if (ok(mid)) {
      r = mid;
    } else
      l = mid + 1;
  }
  if (l == n + 1)
    cout << -1 << '\n';
  else
    cout << l << '\n';
}
void proc() {
  while (t--) {
    solve();
  }
}
signed main() {
  readfile();
  proc();
  return 0;
}
