#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long double PI = acos((long double)-1);
inline int Get_bit(int x, int k) { return (x >> (k - 1)) & 1; }
inline long long Gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long Lcm(long long a, long long b) { return a / Gcd(a, b) * b; }
inline long long Pow(long long n, long long k) {
  long long r = 1;
  for (; k; k >>= 1, n = n * n % MOD) {
    if (k & 1) r = r * n % MOD;
  }
  return r;
}
const int base = 311;
const int N = 2e5 + 5;
long long n, m, k, ans, query;
long long a[N];
void Solve() {
  int q;
  cin >> q;
  string s, t;
  while (q--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    long long x, p, y, r;
    cin >> x >> p;
    cin >> y >> r;
    cin >> k;
    sort(a + 1, a + n + 1, greater<long long>());
    for (int i = 1; i <= n; i++) {
      a[i] = a[i - 1] + a[i];
    }
    long long res = 0;
    long long g = Lcm(p, r);
    int vp = 0, vr = 0, vg = 0;
    if (x < y) swap(p, r), swap(x, y);
    for (int i = 1; i <= n; i++) {
      if (i % g == 0) {
        vg++;
      } else {
        if (i % p == 0) {
          vp++;
        } else {
          if (i % r == 0) vr++;
        }
      }
      res = (a[vg]) * (x + y) / 100;
      res += (a[vg + vp] - a[vg]) * x / 100;
      res += (a[vg + vp + vr] - a[vg + vp]) * y / 100;
      if (res >= k) {
        cout << i << "\n";
        break;
      }
    }
    if (res < k) cout << "-1\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(10);
  Solve();
}
