#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
bool cmp(const pair<int, int>& a, const pair<int, int>& b) {
  if (a.first > b.first) {
    return 1;
  }
  if (a.first < b.first) {
    return 0;
  }
  return (a.second <= b.second);
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
      int elem;
      cin >> elem;
      p[i] = elem;
    }
    sort(p.begin(), p.end());
    reverse(p.begin(), p.end());
    int x, a;
    cin >> x >> a;
    int y, b;
    cin >> y >> b;
    ll k;
    cin >> k;
    int l = 0;
    int r = n;
    int res = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      vector<pair<int, int>> prop(mid);
      for (int i = 0; i < mid; i++) {
        int val = 0;
        if ((i + 1) % a == 0) {
          val += x;
        }
        if ((i + 1) % b == 0) {
          val += y;
        }
        prop[i] = {val, i};
      }
      sort(prop.begin(), prop.end(), cmp);
      vector<pair<int, int>> order(mid);
      for (int i = 0; i < mid; i++) {
        order[prop[i].second] = {p[i] / 100, prop[i].first};
      }
      ll tot = 0;
      for (auto idx : order) {
        tot += (idx.first * idx.second);
      }
      if (tot >= k) {
        res = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    cout << res << endl;
  }
}
