#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int ar[200005];
long long int n, x, a, y, b, k, gc;
bool fun(long long int xx) {
  if (xx == 0) return true;
  long long int aa = 0, bb = 0, cc = 0, sum = 0;
  cc = xx / gc;
  aa = (xx / a) - cc;
  bb = (xx / b) - cc;
  sum = ((x + y) * (ar[cc])) / 100;
  sum += ((x) * (ar[aa + cc] - ar[cc])) / 100;
  sum += ((y) * (ar[aa + bb + cc] - ar[cc + aa])) / 100;
  if (sum >= k)
    return false;
  else
    return true;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> ar[i];
    }
    sort(ar + 1, ar + n + 1);
    for (int i = 0; i < n / 2; i++) {
      swap(ar[i + 1], ar[n - i]);
    }
    for (int i = 1; i <= n; i++) {
      ar[i] += ar[i - 1];
    }
    cin >> x >> a >> y >> b >> k;
    if (y > x) {
      swap(x, y);
      swap(a, b);
    }
    gc = (a * b) / gcd(a, b);
    long long int l = 0, r = n;
    if (fun(n)) {
      cout << -1 << endl;
      continue;
    }
    while (l < r) {
      long long int mid = (l + r + 1) / 2;
      if (fun(mid)) {
        l = mid;
      } else
        r = mid - 1;
    }
    cout << l + 1 << endl;
  }
  return 0;
}
