#include <bits/stdc++.h>
using namespace std;
long long calc(vector<int> &v, int md, int a, int b, int x, int y,
               long long lcm) {
  int ta = 0, tb = 0, tm = 0;
  for (int i = 1; i <= md; i++) {
    if (i % a == 0 && i % b == 0) {
      tm++;
    } else if (i % a == 0) {
      ta++;
    } else if (i % b == 0) {
      tb++;
    }
  }
  long long sum = 0;
  for (int i = 1; i <= tm; i++) {
    sum += 1ll * (x + y) * v[i] / 100;
  }
  int cnt = tm + 1;
  long long suma = 0ll;
  for (int i = 1; i <= ta; i++) {
    suma += 1ll * x * v[cnt++] / 100;
  }
  for (int i = 1; i <= tb; i++) {
    suma += 1ll * y * v[cnt++] / 100;
  }
  cnt = tm + 1;
  long long sumb = 0ll;
  for (int i = 1; i <= tb; i++) {
    sumb += 1ll * y * v[cnt++] / 100;
  }
  for (int i = 1; i <= ta; i++) {
    sumb += 1ll * x * v[cnt++] / 100;
  }
  return sum + max(suma, sumb);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    vector<int> v(n + 1, 0);
    for (int i = 1; i <= n; i++) {
      cin >> v[i];
    }
    int x, a;
    cin >> x >> a;
    int y, b;
    cin >> y >> b;
    long long k;
    cin >> k;
    sort(v.begin() + 1, v.end(), greater<int>());
    long long lcm = 0;
    int l = 1, r = n;
    int ans = -1;
    while (l <= r) {
      int md = l + (r - l) / 2;
      long long sum = calc(v, md, a, b, x, y, lcm);
      if (sum >= k) {
        ans = md;
        r = md - 1;
      } else {
        l = md + 1;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
