#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 1;
const long long MOD = 1e9 + 7;
const long long MAXN = 1e5 + 1;
const long double EPS = 1e-12;
const long double PI = acos(-1);
const long long XX[] = {0, -1, 0, 1, 0, -1};
const long long YY[] = {-1, 0, 1, 0, -1, 0};
const long long ALPH = 31;
void bye() {
  cout << "\n";
  exit(0);
}
bool get(vector<long long> &g, long long k, long long x, long long a,
         long long y, long long b, long long need) {
  long long res = 0;
  vector<long long> rasp(k + 1);
  for (long long i = a; i <= k; i += a) {
    rasp[i] += x;
  }
  for (long long i = b; i <= k; i += b) {
    rasp[i] += y;
  }
  sort((rasp).begin(), rasp.end());
  reverse((rasp).begin(), rasp.end());
  for (long long i = 0; i < k; i++) {
    res += rasp[i] * (g[i] / 100);
  }
  return res >= need;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    vector<long long> g(n);
    for (long long i = 0; i < n; i++) {
      cin >> g[i];
    }
    sort((g).begin(), g.end());
    reverse((g).begin(), g.end());
    long long x, a;
    long long y, b;
    cin >> x >> a;
    cin >> y >> b;
    long long need;
    cin >> need;
    long long l = 0, r = n;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if (get(g, mid, x, a, y, b, need)) {
        r = mid;
      } else {
        l = mid;
      }
    }
    if (get(g, r, x, a, y, b, need)) {
      cout << r << "\n";
    } else {
      cout << -1 << "\n";
    }
  }
  bye();
}
