#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
char dir[] = {'R', 'L', 'D', 'U'};
const int MOD = 1e9 + 7;
const int INF = 1e9;
bool cmp(int a, int b) { return a > b; }
bool find(int mid, vector<long long> a, pair<long long, long long> x,
          pair<long long, long long> y, int n, long long totalcont) {
  queue<int> multx, multy, multboth;
  for (int i = 1; i <= mid; i++) {
    if (i % x.second == 0 && i % y.second == 0)
      multboth.push(i);
    else if (i % x.second == 0)
      multx.push(i);
    else if (i % y.second == 0)
      multy.push(i);
  }
  long long count = 0;
  int idx = 0;
  while (!multboth.empty()) {
    multboth.pop();
    count += (a[idx] * ((x.first + y.first)) / 100);
    idx++;
  }
  while (!multx.empty()) {
    multx.pop();
    count += ((a[idx] * x.first) / 100);
    idx++;
  }
  while (!multy.empty()) {
    multy.pop();
    count += ((a[idx] * y.first) / 100);
    idx++;
  }
  return count >= totalcont;
}
void solve() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort((a).begin(), (a).end(), cmp);
  pair<long long, long long> x, y;
  cin >> x.first >> x.second >> y.first >> y.second;
  if (x.first < y.first) swap(x, y);
  long long k;
  cin >> k;
  int l = -1, r = n;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (find(mid, a, x, y, n, k)) {
      r = mid;
    } else
      l = mid;
  }
  bool flag = 1;
  if (find(n, a, x, y, n, k)) flag = 0;
  cout << (flag ? -1 : r) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  if (fopen("file.in", "r")) {
    freopen("file.in", "r", stdin);
    freopen("file.out", "w", stdout);
  }
  int t = 1;
  cin >> t;
  while (t-- > 0) solve();
}
