#include <bits/stdc++.h>
using namespace std;
long long k;
bool comp(long long a, long long b) {
  if (a > b)
    return true;
  else
    return false;
}
void solve() {
  int n, x, a, y, b;
  cin >> n;
  vector<long long> p(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    p[i] /= 100;
  }
  cin >> x >> a >> y >> b >> k;
  sort(p.rbegin(), p.rend());
  vector<long long> coef(n);
  for (int i = a - 1; i < n; i += a) coef[i] += x;
  for (int i = b - 1; i < n; i += b) coef[i] += y;
  auto func = [&](int r) {
    vector<long long> c;
    for (int i = 0; i < r; i++) c.push_back(coef[i]);
    sort(c.rbegin(), c.rend());
    long long ans = 0;
    for (int i = 0; i < r; i++) ans += p[i] * c[i];
    return ans >= k;
  };
  if (!func(n)) {
    cout << -1 << '\n';
    return;
  }
  int l = 0, r = n;
  while (l < r - 1) {
    int m = (l + r) / 2;
    if (func(m))
      r = m;
    else
      l = m;
  }
  cout << r << '\n';
}
int main() {
  int q;
  cin >> q;
  while (q--) solve();
  return 0;
}
