#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e9;
mt19937 ran(time(0));
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q, n;
  long long x, a, y, b, k;
  cin >> q;
  long long l, r, mid;
  long long t;
  long double c;
  int ind;
  long long ans;
  for (long long z = 0; z < q; z++) {
    cin >> n;
    vector<long long> p(n);
    for (long long i = 0; i < n; i++) cin >> p[i];
    cin >> x >> a >> y >> b >> k;
    sort(p.begin(), p.end());
    l = 0;
    r = n - 1;
    ans = -1;
    while (l <= r) {
      multiset<long long> cfs;
      mid = (l + r) / 2;
      t = 0;
      for (int i = 0; i <= mid; i++) {
        c = 0;
        if ((i + 1) % a == 0) c += x;
        if ((i + 1) % b == 0) c += y;
        cfs.insert(c);
      }
      ind = n - 1;
      for (auto m = --cfs.end();; m--) {
        t += (*m) * p[ind] / 100;
        ind--;
        if (m == cfs.begin()) break;
      }
      if (t >= k) {
        r = mid - 1;
        ans = mid + 1;
      } else {
        l = mid + 1;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
