#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
const long long MOD = 998244353;
const long long INF = 1e17;
const long long INT_INF = 1e9;
const double pi = acos(-1);
const double EPS = 1e-10;
const long long MAX = 200020;
long long gcd(long long x, long long y) {
  long long m = max(x, y), n = min(x, y);
  if (m % n == 0)
    return n;
  else
    return gcd(m % n, n);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
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.begin(), p.end());
  ;
  reverse(p.begin(), p.end());
  ;
  long long x, a, y, b;
  cin >> x >> a >> y >> b;
  if (x < y) {
    swap(x, y);
    swap(a, b);
  }
  long long K;
  cin >> K;
  long long L = lcm(a, b);
  long long ans = 0;
  long long ok = N + 1, ng = 0;
  while (ok - ng > 1) {
    long long mid = (ok + ng) / 2;
    bool pos = false;
    long long res = 0;
    long long idx = 0;
    long long c = 0, ca = 0, cb = 0;
    for (long long i = 1; i < mid + 1; i++) {
      if (i % L == 0) {
        c++;
      } else if (i % a == 0)
        ca++;
      else if (i % b == 0)
        cb++;
    }
    for (long long i = 0; i < c; i++) {
      res += p[idx] / 100 * (x + y);
      ans++;
      idx++;
    }
    for (long long i = 0; i < ca; i++) {
      res += p[idx] / 100 * x;
      ans++;
      idx++;
    }
    for (long long i = 0; i < cb; i++) {
      res += p[idx] / 100 * y;
      ans++;
      idx++;
    }
    if (res >= K) pos = true;
    if (pos)
      ok = mid;
    else
      ng = mid;
  }
  if (ok == N + 1)
    cout << -1 << '\n';
  else
    cout << ok << '\n';
  ;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long Q;
  cin >> Q;
  while (Q--) solve();
}
