#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int q, f[N], n, x, a, y, b;
long long k, t;
bool cmp(int a, int b) { return a > b; }
bool check(int now) {
  int j = 1;
  long long s1 = a, s2 = b;
  long long s3 = t;
  long long ans = 0;
  while (s3 <= now) {
    ans += 1ll * f[j] * x / 100 + 1ll * f[j] * y / 100;
    s3 += t;
    j++;
  }
  while (s1 <= now) {
    if (s1 % b == 0) {
      s1 += a;
      continue;
    }
    ans += 1ll * f[j] * x / 100;
    s1 += a;
    j++;
  }
  while (s2 <= now) {
    if (s2 % a == 0) {
      s2 += b;
      continue;
    }
    ans += 1ll * f[j] * y / 100;
    s2 += b;
    j++;
  }
  return ans >= k;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  scanf("%d", &q);
  while (q--) {
    long long s = 0;
    bool flag = 1;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &f[i]), s += f[i];
    sort(f + 1, f + n + 1, cmp);
    scanf("%d%d%d%d%I64d", &x, &a, &y, &b, &k);
    if (x < y) swap(x, y), swap(a, b);
    t = 1ll * a / gcd(a, b) * 1ll * b;
    int l = 1, r = n, ans = n;
    while (l <= r) {
      int mid = l + r >> 1;
      if (check(mid))
        ans = mid, r = mid - 1;
      else if (mid == n) {
        printf("-1\n");
        flag = 0;
        break;
      } else
        l = mid + 1;
    }
    if (flag) {
      printf("%d\n", ans);
    }
  }
  return 0;
}
