#include <bits/stdc++.h>
const int N = 2e5 + 10;
using namespace std;
long long n, m, q, a, x, b, y, k, g, l = 1, r = n, sum = 0, ans, mid;
long long t1[N], t2[N];
bool cmp(long long a, long long b) { return a > b; }
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  cin >> q;
  while (q--) {
    memset(t2, 0, sizeof(t2));
    cin >> n;
    for (long long i = 1; i <= n; i++) {
      cin >> t1[i];
    }
    sort(t1 + 1, t1 + n + 1, cmp);
    cin >> x >> a >> y >> b >> k;
    g = gcd(a, b);
    g = a * b / g;
    l = 1;
    r = n;
    ans = 0;
    while (l <= r) {
      mid = (l + r) / 2;
      memset(t2, 0, sizeof(t2));
      for (long long i = 1; i <= mid; i++) {
        if (i % g == 0) {
          t2[i] = x + y;
        } else if (i % a == 0) {
          t2[i] = x;
        } else if (i % b == 0) {
          t2[i] = y;
        }
      }
      sum = 0;
      sort(t2 + 1, t2 + mid + 1, cmp);
      for (long long i = 1; i <= mid; i++) {
        sum += t1[i] * t2[i];
      }
      if (sum >= k * 100) {
        r = mid - 1;
        ans = mid;
      } else {
        l = mid + 1;
      }
    }
    if (!ans)
      cout << "-1" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
