#include <bits/stdc++.h>
using namespace std;
template <typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) {
  return os << '(' << pai.first << ' ' << pai.second << ')';
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
  cout << '[';
  for (auto p : v) cout << p << ",";
  cout << "]";
  return os;
}
template <typename T, typename V>
ostream &operator<<(ostream &os, const set<T, V> v) {
  cout << "{";
  for (auto p : v) cout << p << ",";
  cout << "}";
  return os;
}
template <typename T, typename V>
ostream &operator<<(ostream &os, const map<T, V> v) {
  cout << "{";
  for (auto p : v) cout << p << ",";
  cout << "}";
  return os;
}
template <typename T>
void get_max(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void get_min(T &a, T b) {
  a = min(a, b);
}
int N;
long long K;
int A[200000];
int x, a, y, b;
int gcd(int a, int b) {
  if (a > b) swap(a, b);
  if (a == 0) return b;
  return gcd(b % a, a);
}
void solve() {
  cin >> N;
  for (int i = 0, _i = (N); i < _i; i++) cin >> A[i], A[i] /= 100;
  cin >> x >> a >> y >> b >> K;
  sort(A, A + N, greater<int>());
  int l = 1, r = N + 1;
  long long lcm = (long long)a * b / gcd(a, b);
  while (l < r) {
    int mid = (l + r) / 2;
    int pab = mid / lcm;
    int pa = mid / a - pab;
    int push_back = mid / b - pab;
    long long val = 0;
    for (int i = 0, _i = (pab); i < _i; i++) val += (long long)A[i] * (x + y);
    if (x > y) {
      for (int i = 0, _i = (pa); i < _i; i++) val += (long long)A[i + pab] * x;
      for (int i = 0, _i = (push_back); i < _i; i++)
        val += (long long)A[i + pab + pa] * y;
    } else {
      for (int i = 0, _i = (push_back); i < _i; i++)
        val += (long long)A[i + pab] * y;
      for (int i = 0, _i = (pa); i < _i; i++)
        val += (long long)A[i + pab + push_back] * x;
    }
    if (val >= K)
      r = mid;
    else
      l = mid + 1;
  }
  if (l > N)
    cout << -1 << '\n';
  else
    cout << l << '\n';
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int Q;
  cin >> Q;
  while (Q--) solve();
}
