#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e9, MAXMOD = 1e9 + 10;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long> pref;
long long Pref(long long i, long long j) { return pref[j] - pref[i]; }
int main() {
  long long T;
  cin >> T;
  while (T--) {
    long long n, k, x, a, y, b;
    cin >> n;
    vector<long long> v(n);
    for (auto &el : v) cin >> el;
    cin >> x >> a >> y >> b >> k;
    k *= 100;
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    sort(v.begin(), v.end());
    pref = vector<long long>(n + 1, 0);
    for (long long i = 1; i <= n; i++) pref[i] = pref[i - 1] + v[i - 1];
    long long l = 0, r = n + 1;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      long long LCD = a * b / gcd(a, b);
      long long both = m / LCD, first = m / a - both, second = m / b - both;
      long long ans = Pref(n - both, n) * (x + y) +
                      Pref(n - both - first, n - both) * x +
                      Pref(n - both - first - second, n - both - first) * y;
      if (ans >= k)
        r = m;
      else
        l = m;
    }
    if (r == n + 1)
      cout << "-1\n";
    else
      cout << r << "\n";
  }
}
