#include <bits/stdc++.h>
using namespace std;
long long price[200002];
long long a, b, x, y, k;
long long gcd(long long aa, long long bb) {
  return (bb != 0) ? gcd(bb, aa % bb) : aa;
}
bool check(long long mid) {
  long long tt = mid / (a * b / gcd(a, b));
  long long ta = mid / a;
  long long tb = mid / b;
  long long total = 0;
  for (int i = 1; i <= tt; i++) {
    total += price[i] * (x + y);
  }
  for (int i = tt + 1; i <= ta; i++) {
    total += price[i] * x;
  }
  for (int i = ta + 1; i <= ta + tb - tt; i++) {
    total += price[i] * y;
  }
  if (total >= k) {
    return true;
  }
  return false;
}
int main() {
  int q, n;
  cin >> q;
  while (q--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> price[i + 1];
      price[i + 1] /= 100;
    }
    sort(price + 1, price + n + 1, greater<int>());
    cin >> x >> a >> y >> b;
    cin >> k;
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    int l = 1, r = n, res = -1;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (check(mid)) {
        res = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    cout << res << endl;
  }
  return 0;
}
