#include <bits/stdc++.h>
using namespace std;
vector<long long> q1;
vector<long long> q2;
long long n, x, y, a, b, k;
long long l = 1, r = n;
long long ans = 0;
long long mid;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool cmp(long long a, long long b) { return a > b; }
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    q1.clear();
    scanf("%lld", &n);
    for (int i = 1; i <= n; i++) {
      long long t;
      scanf("%lld", &t);
      q1.push_back(t);
    }
    scanf("%lld %lld %lld %lld %lld", &x, &a, &y, &b, &k);
    long long gc = gcd(a, b);
    long long lcm = a * b / gc;
    sort(q1.begin(), q1.end(), cmp);
    l = 1, r = n;
    ans = 0;
    while (l <= r) {
      q2.clear();
      mid = (l + r) / 2;
      for (int j = 1; j <= mid; j++) {
        if (j % lcm == 0) {
          q2.push_back(x + y);
        } else if (j % a == 0) {
          q2.push_back(x);
        } else if (j % b == 0) {
          q2.push_back(y);
        }
      }
      long long res = 0;
      sort(q2.begin(), q2.end(), cmp);
      for (int i = 0; i < q2.size(); i++) {
        res += q1[i] * q2[i];
      }
      if (res >= k * 100) {
        r = mid - 1;
        ans = mid;
      } else {
        l = mid + 1;
      }
    }
    if (!ans)
      printf("-1\n");
    else
      printf("%lld\n", ans);
  }
  return 0;
}
