#include <bits/stdc++.h>
using namespace std;
const long long N = 1000002, M = 998244353;
long long pw(long long x, long long y) {
  long long z = 1;
  for (; y; y >>= 1, x = 1ll * x * x % M)
    if (y & 1) z = 1ll * z * x % M;
  return z;
}
void inc(long long &x, long long y) {
  x += y;
  if (x >= M) x -= M;
}
void dec(long long &x, long long y) {
  x -= y;
  if (x < 0) x += M;
}
void Max(long long &x, long long y) {
  if (y > x) x = y;
}
void Min(long long &x, long long y) {
  if (y < x) x = y;
}
long long T, n, p[N], x, y, a, b, k, fl[N], i, now, ans, sum;
priority_queue<long long> q1, q2, q3;
signed main() {
  scanf("%lld", &T);
  for (; T--;) {
    scanf("%lld", &n);
    for (i = 1; i <= n; i++) scanf("%lld", &p[i]), p[i] /= 100;
    sort(p + 1, p + n + 1);
    scanf("%lld%lld%lld%lld%lld", &x, &a, &y, &b, &k);
    if (x > y) swap(x, y), swap(a, b);
    for (i = 0; i <= n; i++) fl[i] = 0;
    for (i = a; i <= n; i += a) fl[i] = 1;
    for (i = b; i <= n; i += b)
      if (!fl[i])
        fl[i] = 2;
      else
        fl[i] = 3;
    now = n, ans = -1, sum = 0;
    for (i = 1; i <= n; i++)
      if (fl[i]) {
        q1.push(p[now]), sum += x * p[now], now--;
        if (fl[i] >= 2) q2.push(q1.top()), sum += (y - x) * q1.top(), q1.pop();
        if (fl[i] == 3) q3.push(q2.top()), sum += x * q2.top(), q2.pop();
        if (sum >= k) {
          ans = i;
          break;
        }
      }
    while (!q1.empty()) q1.pop();
    while (!q2.empty()) q2.pop();
    while (!q2.empty()) q3.pop();
    printf("%lld\n", ans);
  }
}
