#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <typename T>
void _dbg(const char* _s, T _h) {
  cerr << _s << " = " << _h << "\n";
}
template <typename T, typename... Ts>
void _dbg(const char* _s, T _h, Ts... _t) {
  for (int _b = 0; ((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',';)
    cerr << *_s++;
  cerr << " = " << _h << ",";
  _dbg(_s + 1, _t...);
}
const long long N = 200 * 1000 + 17;
const long long MOD = 1000 * 1000 * 1000 + 7;
long long n, first, a, y, b, k;
long long p[N];
bool read() {
  if (!(cin >> n)) return false;
  for (long long i = 0; i < (long long)(n); ++i) cin >> p[i];
  cin >> first >> a >> y >> b >> k;
  return true;
}
bool check(long long m) {
  long long j = 0;
  long long res = 0;
  for (long long i = 1; i <= m; ++i) {
    if (i % a == 0 && i % b == 0) res += (p[j++] / 100) * (first + y);
  }
  for (long long i = 1; i <= m; ++i) {
    if (i % a == 0 && i % b == 0) continue;
    if (i % a == 0) res += (p[j++] / 100) * first;
  }
  for (long long i = 1; i <= m; ++i) {
    if (i % a == 0 && i % b == 0) continue;
    if (i % b == 0) res += (p[j++] / 100) * y;
  }
  return res >= k;
}
void solve() {
  if (first < y) {
    swap(first, y);
    swap(a, b);
  }
  sort(p, p + n);
  reverse(p, p + n);
  if (!check(n)) {
    cout << -1 << '\n';
    return;
  }
  long long l = 1, r = n;
  for (; l < r;) {
    long long m = (l + r) / 2;
    if (!check(m))
      l = m + 1;
    else
      r = m;
  }
  cout << l << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long ttt;
  cin >> ttt;
  while (read()) solve();
  return 0;
}
