#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long x = a, y = b;
  if (y > x) {
    swap(x, y);
  }
  while (y != 0) {
    x = x % y;
    swap(x, y);
  }
  return (a * b) / x;
}
long long x, a, y, b, k, c;
bool checker(long long n, long long k, const vector<long long>& p) {
  long long m = (long long)p.size() - 1;
  if (m == 2) {
  }
  long long _c = n / c;
  long long _a = n / a - _c;
  long long _b = n / b - _c;
  long long sum = 0;
  for (long long i = 0; i < _c; ++i) {
    sum += p[m - i] * (x + y) / 100;
  }
  for (long long i = _c; i < _c + _a; ++i) {
    sum += p[m - i] * x / 100;
  }
  for (long long i = _c + _a; i < _c + _a + _b; ++i) {
    sum += p[m - i] * y / 100;
  }
  return sum >= k;
}
signed main() {
  long long q;
  cin >> q;
  vector<long long> p;
  for (long long qwerty = 0; qwerty < q; ++qwerty) {
    long long n;
    cin >> n;
    vector<long long>(n).swap(p);
    for (long long i = 0; i < n; ++i) {
      cin >> p[i];
    }
    sort(p.begin(), p.end());
    cin >> x >> a >> y >> b >> k;
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    c = gcd(a, b);
    long long L = 0;
    long long R = n;
    while (L + 1 < R) {
      long long m = (L + R) / 2;
      if (checker(m, k, p)) {
        R = m;
      } else {
        L = m;
      }
    }
    if (checker(R, k, p)) {
      cout << R << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
