#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
void print_time() {}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
template <class T>
ostream& operator<<(ostream& out, vector<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
template <class T>
ostream& operator<<(ostream& out, set<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
template <class L, class R>
ostream& operator<<(ostream& out, map<L, R> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
void solve() {
  long long n;
  cin >> n;
  vector<long long> p(n);
  for (long long i = 0; i < n; ++i) {
    cin >> p[i];
  }
  sort((p).rbegin(), (p).rend());
  vector<long long> ps(n + 1);
  for (long long i = 1; i < n + 1; ++i) {
    ps[i] = ps[i - 1] + p[i - 1];
  }
  long long x, y, a, b, k;
  cin >> x >> a;
  cin >> y >> b;
  cin >> k;
  long long g = lcm(a, b);
  if (x > y) {
    swap(x, y);
    swap(a, b);
  }
  long long l = 0;
  long long r = n + 1;
  while (l + 1 < r) {
    long long mid = (l + r) / 2;
    long long cxy = mid / g;
    long long cx = mid / a - cxy;
    long long cy = mid / b - cxy;
    long long kk = 0;
    kk += (x + y) * ps[cxy] / 100;
    kk += y * (ps[cxy + cy] - ps[cxy]) / 100;
    kk += x * (ps[cxy + cy + cx] - ps[cxy + cy]) / 100;
    if (kk >= k) {
      r = mid;
    } else {
      l = mid;
    }
  }
  if (r == n + 1) {
    cout << (-1) << "\n";
    return;
  }
  cout << r << "\n";
}
int main() {
  cout << fixed << setprecision(20);
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    solve();
  }
  print_time();
  return 0;
}
