#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using Pii = pair<int, int>;
constexpr int MAX = 1000100;
int p[MAX];
i64 Gcd(i64 a, i64 b) { return b ? Gcd(b, a % b) : a; }
i64 Lcm(i64 a, i64 b) { return a / Gcd(a, b) * b; }
bool Check(int m, int x, i64 a, int y, i64 b, i64 k) {
  i64 c = Lcm(a, b);
  i64 nc = m / c, na = m / a - nc, nb = m / b - nc;
  i64 sum = 0;
  for (int i = 0; i < m && i < nc; ++i) {
    sum += (i64)p[i] / 100LL * (i64)(x + y);
    if (sum >= k) return true;
  }
  if (x > y) {
    for (int i = nc; i < m && i < nc + na; ++i) {
      sum += (i64)p[i] / 100LL * (i64)x;
      if (sum >= k) return true;
    }
    for (int i = nc + na; i < m && i < nc + na + nb; ++i) {
      sum += (i64)p[i] / 100LL * (i64)y;
      if (sum >= k) return true;
    }
  } else {
    for (int i = nc; i < m && i < nc + nb; ++i) {
      sum += (i64)p[i] / 100LL * (i64)y;
      if (sum >= k) return true;
    }
    for (int i = nc + nb; i < m && i < nc + na + nb; ++i) {
      sum += (i64)p[i] / 100LL * (i64)x;
      if (sum >= k) return true;
    }
  }
  return false;
}
int Solve(int n, int x, int a, int y, int b, i64 k) {
  sort(p, p + n, greater<int>());
  int low = 1, high = n, ret = -1;
  while (low <= high) {
    int mid = (low + high) / 2;
    if (Check(mid, x, a, y, b, k)) {
      ret = mid;
      high = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  return ret;
}
int main() {
  int q, n, x, a, y, b;
  i64 k;
  scanf("%d", &q);
  for (int ct = 1; ct <= q; ++ct) {
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
      scanf("%d", &p[i]);
    }
    scanf("%d%d%d%d%lld", &x, &a, &y, &b, &k);
    int ans = Solve(n, x, a, y, b, k);
    printf("%d\n", ans);
  }
  return 0;
}
