#include <bits/stdc++.h>
using namespace std;
long long q, n, f[200005], sum[200005], x, a, y, b, k, lc;
long long gcd(long long x, long long y) {
  if (x < y) swap(x, y);
  if (x % y == 0) return y;
  return gcd(y, x % y);
}
bool ok(long long m) {
  long long i = m / lc, j = m / a - i, l = m / b - i;
  long long res = (x + y) * sum[min(i, n)];
  res += x * (sum[min(i + j, n)] - sum[min(i, n)]);
  res += y * (sum[min(i + j + l, n)] - sum[min(i + j, n)]);
  return res >= k;
}
int main() {
  scanf("%lld", &q);
  while (q--) {
    scanf("%lld", &n);
    for (long long i = 1; i <= n; i++) scanf("%lld", &f[i]);
    scanf("%lld%lld%lld%lld%lld", &x, &a, &y, &b, &k);
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    lc = a / gcd(a, b) * b;
    k *= 100;
    sort(f + 1, f + 1 + n);
    reverse(f + 1, f + 1 + n);
    for (long long i = 1; i <= n; i++) sum[i] = sum[i - 1] + f[i];
    long long l = 1, r = n, ans = 0, mid;
    while (l <= r) {
      mid = (l + r) / 2;
      if (ok(mid)) {
        r = mid - 1;
        ans = mid;
      } else {
        l = mid + 1;
      }
    }
    if (ans == 0)
      printf("-1\n");
    else
      printf("%lld\n", ans);
  }
  return 0;
}
