#include <bits/stdc++.h>
using namespace std;
long long q, n, h, x, y, a, b, k, s;
long long p[200000];
long long sum[200000];
long long NOD(long long a, long long b) {
  if (a > 0 && b > 0) {
    a = a % b;
    return NOD(b, a);
  } else
    return a + b;
}
int binpoisk(long long p, long long q, long long k) {
  if (q == p + 1) {
    if (q == n + 1)
      return -1;
    else
      return q;
  } else {
    long long r = (p + q) / 2, d;
    long long m1, m2, m3;
    m1 = r / s;
    m2 = r / a - m1;
    m3 = r / b - m1;
    d = sum[m1] * (x + y) + x * (sum[m1 + m2] - sum[m1]) +
        y * (sum[m1 + m2 + m3] - sum[m1 + m2]);
    d = d / 100;
    if (d >= k)
      return binpoisk(p, r, k);
    else
      return binpoisk(r, q, k);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> q;
  while (q--) {
    cin >> n;
    for (int i = 0; i < n; ++i) {
      cin >> h;
      p[i] = -h;
    }
    cin >> x >> a >> y >> b;
    cin >> k;
    sort(p, p + n);
    sum[0] = 0;
    for (int i = 0; i < n; ++i) {
      p[i] *= -1;
      sum[i + 1] = sum[i] + p[i];
    }
    s = a * b / NOD(a, b);
    if (x < y) {
      h = y;
      y = x;
      x = h;
      h = b;
      b = a;
      a = h;
    }
    cout << binpoisk(0, n + 1, k) << endl;
  }
  return 0;
}
