#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
constexpr int DEBUG = 0;
int SolveCase() {
  int n;
  cin >> n;
  vector<int64> ps(n);
  for (int i = 0; i < n; i++) {
    cin >> ps[i];
  }
  sort(ps.begin(), ps.end());
  reverse(ps.begin(), ps.end());
  int x, a;
  int y, b;
  cin >> x >> a >> y >> b;
  if (x < y) {
    swap(x, y);
    swap(a, b);
  }
  int64 min_score;
  cin >> min_score;
  auto solve_for_k = [&](int k) -> bool {
    int xy_count = 0;
    int x_count = 0;
    int y_count = 0;
    for (int i = 0; i < k; i++) {
      if ((i + 1) % a == 0 && (i + 1) % b == 0) {
        xy_count++;
      } else if ((i + 1) % a == 0) {
        x_count++;
      } else if ((i + 1) % b == 0) {
        y_count++;
      }
    }
    int64 score = 0;
    for (int i = 0; i < xy_count; i++) {
      score += ps[i] / 100 * (x + y);
    }
    for (int i = xy_count; i < xy_count + x_count; i++) {
      score += ps[i] / 100 * x;
    }
    for (int i = xy_count + x_count; i < xy_count + x_count + y_count; i++) {
      score += ps[i] / 100 * y;
    }
    if (DEBUG) cout << "k: " << k << " score: " << score << endl;
    return score >= min_score;
  };
  if (!solve_for_k(n)) return -1;
  int l = 0;
  int r = n;
  while (r - l >= 2) {
    int m = (l + r) / 2;
    if (solve_for_k(m)) {
      r = m;
    } else {
      l = m;
    }
  }
  return r;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cout << SolveCase() << endl;
  }
}
