#include <bits/stdc++.h>
const long long LL_INF = (long long)2e18 + 5;
using namespace std;
const long long N = 2e5 + 10;
void solve() {
  long long n, a0, a, b0, b, k;
  cin >> n;
  vector<long long> v(n), pref(n + 1);
  ;
  {
    for (auto &i : v) cin >> i;
  }
  sort(v.begin(), v.end()), reverse(v.begin(), v.end());
  for (long long i = (long long)(1); i < (long long)(n + 1); i++)
    pref[i] = pref[i - 1] + v[i - 1];
  cin >> a0 >> a >> b0 >> b >> k;
  if (a0 < b0) swap(a0, b0), swap(a, b);
  auto sum = [&](long long l, long long r) { return pref[r] - pref[l]; };
  long long ctall = 0, cta = 0, ctb = 0;
  for (long long i = (long long)(1); i < (long long)(n + 1); i++) {
    if (i % a == 0 and i % b == 0)
      ctall++;
    else if (i % a == 0)
      cta++;
    else if (i % b == 0)
      ctb++;
    if (sum(0, ctall) * (a0 + b0) / 100 + sum(ctall, ctall + cta) * a0 / 100 +
            sum(ctall + cta, ctall + cta + ctb) * b0 / 100 >=
        k) {
      cout << i << '\n';
      return;
    }
  }
  cout << "-1\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long tt;
  cin >> tt;
  while (tt--) solve();
}
