#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool check(vector<long long> p, long long x, long long a, long long y,
           long long b, long long k, long long lcm, long long cnt) {
  long long max_ans = 0;
  long long temp = 0;
  for (long long i = lcm - 1; i < cnt && temp < cnt; i += lcm) {
    max_ans += (x + y) * p[temp++] / 100;
  }
  for (long long i = a - 1; i < cnt && temp < cnt; i += a) {
    if ((i + 1) % lcm != 0) {
      max_ans += x * p[temp++] / 100;
    }
  }
  for (long long i = b - 1; i < cnt && temp < cnt; i += b) {
    if ((i + 1) % lcm != 0) {
      max_ans += y * p[temp++] / 100;
    }
  }
  return max_ans >= k;
}
void solve_test() {
  long long n;
  cin >> n;
  vector<long long> p(n);
  for (long long i = 0; i < n; i++) cin >> p[i];
  sort(p.rbegin(), p.rend());
  long long x, y, a, b;
  cin >> x >> a >> y >> b;
  if (y > x) {
    swap(x, y);
    swap(a, b);
  }
  long long k;
  cin >> k;
  long long lcm = a * b / gcd(a, b);
  if (!check(p, x, a, y, b, k, lcm, n)) {
    cout << -1 << "\n";
    return;
  }
  long long l = 0, r = n;
  while (r - l > 1) {
    long long m = (r + l) / 2;
    if (check(p, x, a, y, b, k, lcm, m)) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << r << "\n";
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) solve_test();
  return 0;
}
