#include <bits/stdc++.h>
using namespace std;
typedef priority_queue<pair<int, int>, vector<pair<int, int>>,
                       greater<pair<int, int>>>
    rpqpi;
long long gcd(long long big, long long small) {
  if (big % small == 0) return small;
  return gcd(small, big % small);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q, n, x, aa, y, b, le, ri, mid, w, f, s, c, now;
  long long k;
  cin >> q;
  for (int u = 0; u < q; ++u) {
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    sort(a.rbegin(), a.rend());
    vector<long long> p(n + 1, 0);
    for (int i = 0; i < n; ++i) p[i + 1] = p[i] + a[i];
    cin >> x >> aa >> y >> b >> k;
    w = gcd(aa, b);
    if (x < y) {
      swap(x, y);
      swap(aa, b);
    }
    f = n / aa;
    s = n / b;
    c = n / (aa * b / w);
    now = p[c] / 100 * (x + y);
    f -= c;
    s -= c;
    now += (p[f + c] - p[c]) / 100 * x;
    now += (p[s + f + c] - p[f + c]) / 100 * y;
    if (now < k)
      cout << -1 << '\n';
    else {
      le = 0;
      ri = n + 1;
      while (le < ri - 1) {
        mid = (le + ri) / 2;
        f = mid / aa;
        s = mid / b;
        c = mid / (aa * b / w);
        now = p[c] / 100 * (x + y);
        f -= c;
        s -= c;
        now += (p[f + c] - p[c]) / 100 * x;
        now += (p[s + f + c] - p[f + c]) / 100 * y;
        if (now < k) {
          le = mid;
        } else {
          ri = mid;
        }
      }
      cout << ri << '\n';
    }
  }
  return 0;
}
