#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
long long p[maxn];
long long x, a, y, b, k, N;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long cal(int len) {
  long long last = N - len + 1;
  long long n = N;
  long long res = 0;
  long long temp = a * b / gcd(a, b);
  long long n1 = len / temp;
  if (x < y) swap(x, y), swap(a, b);
  long long n2 = len / a - n1;
  long long n3 = len / b - n1;
  int cnt = N;
  while (n >= last && n1) res += p[cnt--] * (x + y) / 100, n1--;
  while (n >= last && n2) res += p[cnt--] * x / 100, n2--;
  while (n >= last && n3) res += p[cnt--] * y / 100, n3--;
  return res;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    scanf("%lld", &N);
    for (int i = 1; i <= N; i++) {
      scanf("%lld", &p[i]);
    }
    scanf("%lld%lld%lld%lld%lld", &x, &a, &y, &b, &k);
    sort(p + 1, p + 1 + N);
    int l = 1;
    int r = N;
    while (l < r) {
      int mid = l + r >> 1;
      if (cal(mid) >= k)
        r = mid;
      else
        l = mid + 1;
    }
    if (cal(l) < k)
      printf("-1\n");
    else
      printf("%d\n", l);
  }
}
