#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tcase;
  cin >> tcase;
  for (int tc = 1; tc <= tcase; tc++) {
    long long int n, i, j, x, a, y, b, k, l, r, m, c, pro, ta, tb;
    cin >> n;
    long long int p[n + 1];
    for (i = 1; i <= n; i++) cin >> p[i];
    cin >> x >> a >> y >> b >> k;
    if (x < y) swap(x, y), swap(a, b);
    sort(p + 1, p + n + 1, greater<int>());
    l = 1, r = n;
    while (l <= r) {
      m = (l + r) / 2;
      c = (a * b) / gcd(a, b);
      c = m / c;
      ta = (m / a) - c;
      tb = (m / b) - c;
      pro = 0, j = 1;
      for (i = 1; i <= c; i++, j++) pro += (p[j] * (x + y)) / (100LL);
      for (i = 1; i <= ta; i++, j++) pro += (p[j] * x) / (100LL);
      for (i = 1; i <= tb; i++, j++) pro += (p[j] * y) / (100LL);
      if (pro >= k)
        r = m - 1;
      else
        l = m + 1;
    }
    if (r > n)
      cout << "-1\n";
    else if (r == n) {
      c = (a * b) / gcd(a, b);
      c = n / c;
      ta = (n / a) - c;
      tb = (n / b) - c;
      pro = 0, j = 1;
      for (i = 1; i <= c; i++, j++) pro += (p[j] * (x + y)) / (100LL);
      for (i = 1; i <= ta; i++, j++) pro += (p[j] * x) / (100LL);
      for (i = 1; i <= tb; i++, j++) pro += (p[j] * y) / (100LL);
      if (pro >= k)
        cout << n << '\n';
      else
        cout << "-1\n";
    } else
      cout << r + 1 << '\n';
  }
}
