#include <bits/stdc++.h>
using namespace std;
int n;
int const maxn = 2e5 + 2;
int p[maxn];
int x, a, y, b;
long long k;
long long cal(int* p, int len, int x, int a, int y, int b) {
  long long ans = 0LL;
  int cxy = 0, cx = 0, cy = 0;
  for (int i = 1; i < len + 1; i++) {
    if (i % a == 0 && i % b == 0)
      cxy++;
    else if (i % a == 0)
      cx++;
    else if (i % b == 0)
      cy++;
  }
  for (int i = 0; i < cxy; i++) {
    ans += p[i] * (x + y);
  }
  for (int i = 0; i < cx; i++) {
    ans += p[i + cxy] * (x);
  }
  for (int i = 0; i < cy; i++) {
    ans += p[i + cx + cxy] * y;
  }
  return ans;
}
int main() {
  int q;
  cin >> q;
  while (q--) {
    memset(p, 0, maxn);
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> p[i];
      p[i] /= 100;
    }
    cin >> x >> a >> y >> b >> k;
    sort(p, p + maxn, greater<int>());
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    int l = 0, r = n + 1;
    while (r - l > 1) {
      int mid = (l + r) / 2;
      if (cal(p, mid, x, a, y, b) >= k) {
        r = mid;
      } else {
        l = mid;
      }
    }
    if (r > n) r = -1;
    cout << r << endl;
  }
}
