#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    vector<long long> p(n);
    for (int i = 0; i < n; i++) cin >> p[i];
    sort(p.rbegin(), p.rend());
    long long x, a, y, b, k;
    cin >> x >> a >> y >> b >> k;
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    multiset<long long> cheap;
    multiset<long long> expensive;
    int ptr = 0, ans = -1;
    long long money = 0;
    for (int i = 1; i <= n; i++) {
      if (i % a == 0 && i % b == 0) {
        if (!expensive.empty()) {
          money += y * (-(*expensive.begin()) / 100);
          expensive.erase(expensive.begin());
          if (cheap.empty()) {
            expensive.insert(-p[ptr]);
            money += x * p[ptr] / 100;
            ptr++;
          } else {
            expensive.insert((*cheap.begin()));
            money += (*cheap.begin()) / 100 * y;
            money += -(*cheap.begin()) / 100 * x;
            cheap.erase(cheap.begin());
            money += y * p[ptr] / 100;
            cheap.insert(-p[ptr]);
            ptr++;
          }
        } else if (!cheap.empty()) {
          money += x * (-(*cheap.begin()) / 100);
          cheap.erase(cheap.begin());
          cheap.insert(-p[ptr]);
          money += y * p[ptr] / 100;
          ptr++;
        } else {
          money += (x + y) * p[ptr] / 100;
          ptr++;
        }
      } else if (i % b == 0) {
        money += p[ptr] / 100 * y;
        cheap.insert(-p[ptr]);
        ptr++;
      } else if (i % a == 0) {
        if (cheap.empty()) {
          money += x * p[ptr] / 100;
          expensive.insert(-p[ptr]);
          ptr++;
        } else {
          money += y * (*cheap.begin()) / 100;
          money += -x * (*cheap.begin()) / 100;
          expensive.insert((*cheap.begin()));
          cheap.erase(cheap.begin());
          money += y * p[ptr] / 100;
          cheap.insert(-p[ptr]);
          ptr++;
        }
      }
      if (money >= k) {
        ans = i;
        break;
      }
    }
    cout << ans << '\n';
  }
}
