#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 20;
const long long INF = LONG_MAX;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    vector<long long> p(n);
    for (auto &i : p) cin >> i;
    long long a, b, x, y;
    cin >> x >> a >> y >> b;
    long long k;
    cin >> k;
    sort(p.rbegin(), p.rend());
    vector<long long> sum(n + 1);
    for (long long i = 1; i <= n; ++i) {
      sum[i] = sum[i - 1] + p[i - 1];
    }
    long long ans = 1e9;
    for (long long k1 = 1; k1 <= n / a; ++k1) {
      if (x > y) {
        long long l = lcm(a, b);
        long long kk = k1 * a;
        long long k2 = kk / b;
        long long ans1 = x * sum[k1] / 100;
        long long ans2 = y * (sum[k2 + k1 - kk / l] - sum[k1]) / 100;
        long long per = y * sum[kk / l] / 100;
        if (ans1 + ans2 + per >= k) {
          ans = min(ans, kk);
        }
      } else {
        long long l = lcm(a, b);
        long long kk = k1 * a;
        long long k2 = kk / b;
        long long ans2 = y * sum[k2] / 100;
        long long ans1 = x * (sum[k2 + k1 - kk / l] - sum[k2]) / 100;
        long long per = x * sum[kk / l] / 100;
        if (ans1 + ans2 + per >= k) {
          ans = min(ans, kk);
        }
      }
    }
    for (long long k2 = 1; k2 <= n / b; ++k2) {
      if (x > y) {
        long long l = lcm(a, b);
        long long kk = k2 * b;
        long long k1 = kk / a;
        long long ans1 = x * sum[k1] / 100;
        long long ans2 = y * (sum[k2 + k1 - kk / l] - sum[k1]) / 100;
        long long per = y * sum[kk / l] / 100;
        if (ans1 + ans2 + per >= k) {
          ans = min(ans, kk);
        }
      } else {
        long long l = lcm(a, b);
        long long kk = k2 * b;
        long long k1 = kk / a;
        long long ans2 = y * sum[k2] / 100;
        long long ans1 = x * (sum[k2 + k1 - kk / l] - sum[k2]) / 100;
        long long per = x * sum[kk / l] / 100;
        if (ans1 + ans2 + per >= k) {
          ans = min(ans, kk);
        }
      }
    }
    if (ans == 1e9) {
      cout << -1 << endl;
    } else
      cout << ans << endl;
  }
  return 0;
}
