#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
long long gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int X[4] = {-1, 1, 0, 0};
int Y[4] = {0, 0, -1, 1};
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool isPerfectSquare(long double x) {
  if (x >= 0) {
    long long sr = sqrt(x);
    return (sr * sr == x);
  }
  return false;
}
long long Bits(long long number) { return (long long)log2(number) + 1; }
bool perfectCube(long long N) {
  long long cube_root;
  cube_root = round(cbrt(N));
  if (cube_root * cube_root * cube_root == N) {
    return true;
  } else {
    return false;
  }
}
unsigned long long power(unsigned long long x, long long y, long long p) {
  unsigned long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
unsigned long long modInverse(unsigned long long n, long long p) {
  return power(n, p - 2, p);
}
unsigned long long nCrModPFermat(unsigned long long n, long long r,
                                 long long p) {
  if (n < r) return 0;
  if (r == 0) return 1;
  unsigned long long fac[n + 1];
  fac[0] = 1;
  for (long long i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
int p[1000005];
void sieve(int p[], int n = 1000003) {
  for (int i = 3; i <= n; i += 2) {
    p[i] = 1;
  }
  for (int i = 3; i * i <= n; i += 2) {
    if (p[i] == 1)
      for (int j = i * i; j <= n; j += i) {
        p[j] = 0;
      }
  }
  p[2] = 1;
  p[1] = p[0] = 0;
}
long long check(long long mid, long long a, long long b, long long x,
                long long y, long long k, long long n, long long arr[]) {
  if (x < y) {
    swap(x, y);
    swap(a, b);
  }
  long long cxy = 0, cx = 0, cy = 0;
  for (long long int i = 1; i <= mid; i++) {
    if (i % a == 0 && i % b == 0)
      cxy++;
    else if (i % a == 0)
      cx++;
    else if (i % b == 0)
      cy++;
  }
  int i = n - 1;
  long long sum = 0;
  while (cxy--) {
    sum += (x + y) * arr[i];
    i--;
  }
  while (cx--) {
    sum += x * arr[i];
    i--;
  }
  while (cy--) {
    sum += y * arr[i];
    i--;
  }
  if (sum >= k) return true;
  return false;
}
void solve() {
  long long n, x, y, a, b, k;
  cin >> n;
  long long arr[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    arr[i] /= 100;
  }
  sort(arr, arr + n);
  cin >> x >> a;
  cin >> y >> b;
  cin >> k;
  long long l = 1, r = n, mid;
  long long ans = n + 1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (check(mid, a, b, x, y, k, n, arr)) {
      ans = min(ans, mid);
      r = mid - 1;
    } else
      l = mid + 1;
  }
  if (ans > n)
    cout << -1 << "\n";
  else
    cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
