#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long MOD = 1000000007;
long double EPS = 1e-9;
long long binpow(long long b, long long p, long long mod) {
  long long ans = 1;
  b %= mod;
  for (; p; p >>= 1) {
    if (p & 1) ans = ans * b % mod;
    b = b * b % mod;
  }
  return ans;
}
void pre() {}
long long n;
long long x, a, b, y;
long long cnt[200200][3];
vector<long long> p;
long long k;
bool check(long long xx) {
  vector<long long> val(3, 0);
  for (long long i = 0; i < (3); ++i) {
    val[i] = cnt[xx - 1][i];
  }
  long long ans = 0;
  for (long long i = 0; i < (xx); ++i) {
    if (val[2] > 0) {
      val[2]--;
      ans += p[i] * (x + y) / 100;
    } else if (val[1] > 0) {
      val[1]--;
      ans += p[i] * y / 100;
    } else if (val[0] > 0) {
      val[0]--;
      ans += p[i] * x / 100;
    }
  }
  return ans < k;
}
void solve() {
  cin >> n;
  p.resize(n);
  for (long long i = 0; i < (n); ++i) {
    cin >> p[i];
  }
  sort((p).begin(), (p).end());
  reverse((p).begin(), (p).end());
  cin >> x >> a;
  vector<long long> contrix(n, 0);
  for (int i = a; i <= n; i += a) {
    contrix[i - 1] = 1;
  }
  cin >> y >> b;
  vector<long long> contriy(n, 0);
  for (int i = b; i <= n; i += b) {
    contriy[i - 1] = 1;
  }
  if (x > y) {
    swap(x, y);
    swap(a, b);
    swap(contrix, contriy);
  }
  cin >> k;
  for (long long i = 0; i < (n); ++i)
    for (long long j = 0; j < (3); ++j) cnt[i][j] = 0;
  for (long long i = 0; i < (n); ++i) {
    if (contrix[i] && contriy[i])
      cnt[i][2] = 1;
    else if (contrix[i])
      cnt[i][0] = 1;
    else if (contriy[i])
      cnt[i][1] = 1;
    if (i) {
      for (long long j = 0; j < (3); ++j) cnt[i][j] += cnt[i - 1][j];
    }
  }
  long long ans = 0;
  for (long long step = n; step; step >>= 1) {
    while (ans + step <= n && check(ans + step)) ans += step;
  }
  ans++;
  if (ans == n + 1) {
    ans = -1;
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  pre();
  long long _t = 1;
  cin >> _t;
  for (long long i = 1; i <= _t; i++) {
    solve();
  }
}
