#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long mod = 1e9 + 7;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long n, x, a, y, b, k, xy, ab;
bool chck(long long cnt, vector<long long>& v) {
  vector<long long> nv(cnt + 1, 0);
  long long ind = 0;
  long long r = 0;
  for (int i = 1; i <= cnt; i++) {
    if (i * ab > cnt) break;
    nv[i * ab] = v[ind++];
    r += nv[i * ab] / 100 * xy;
  }
  for (int i = 1; i <= cnt; i++) {
    if (i * a > cnt) break;
    if (nv[i * a] != 0) continue;
    nv[i * a] = v[ind++];
    r += nv[i * a] / 100 * x;
  }
  for (int i = 1; i <= cnt; i++) {
    if (i * b > cnt) break;
    if (nv[i * b] != 0) continue;
    nv[i * b] = v[ind++];
    r += nv[i * b] / 100 * y;
  }
  return (r >= k);
}
void solve() {
  cin >> n;
  vector<long long> v(n + 1);
  for (int i = 1; i < n + 1; i++) cin >> v[i];
  cin >> x >> a >> y >> b;
  cin >> k;
  if (x < y) {
    swap(a, b);
    swap(x, y);
  }
  xy = x + y;
  ab = a * b / gcd(a, b);
  sort(v.rbegin(), v.rend());
  if (!chck(n, v)) {
    cout << -1 << endl;
    return;
  }
  long long l = 0, r = n, m;
  while (r - l > 1) {
    m = l + (r - l) / 2;
    bool res = chck(m, v);
    if (res) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << r << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t > 0) {
    solve();
    t--;
  }
}
