#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
long long n, m, q;
long long p[300005];
long long x, A, y, B;
long long k;
long long a[300005];
bool judge(long long m) {
  for (long long i = 1; i <= m; i++) {
    a[i] = 0;
    if (i % A == 0) a[i] += x;
    if (i % B == 0) a[i] += y;
  }
  sort(a + 1, a + m + 1);
  long long ans = 0;
  for (long long i = m; i >= 1; i--) {
    ans += a[i] * p[n - m + i];
  }
  return ans >= k;
}
void getans() {
  long long l = 1, r = n;
  while (l + 3 < r) {
    long long mid = (l + r) >> 1;
    if (judge(mid))
      r = mid;
    else
      l = mid;
  }
  for (long long i = l; i <= r; i++)
    if (judge(i)) {
      cout << i << "\n";
      return;
    }
  cout << -1 << "\n";
}
signed main() {
  cin >> q;
  while (q--) {
    cin >> n;
    for (long long i = 1; i <= n; i++) {
      cin >> p[i];
      p[i] /= 100;
    }
    sort(p + 1, p + n + 1);
    cin >> x >> A >> y >> B;
    cin >> k;
    getans();
  }
  return 0;
}
