#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    int p[n];
    for (int i = 0; i < n; i++) scanf("%d", &p[i]);
    int x, a, y, b;
    scanf("%d %d %d %d", &x, &a, &y, &b);
    int l = 0, r = n - 1;
    int ans = -1;
    sort(p, p + n);
    reverse(p, p + n);
    long long k;
    scanf("%lld", &k);
    while (l <= r) {
      int mid = (l + r) / 2;
      int xy = 0, xx = 0, yy = 0;
      for (int i = 0; i <= mid; i++) {
        int nw = i + 1;
        if (nw % a == 0 && nw % b == 0) {
          xy++;
        } else if (nw % a == 0)
          xx++;
        else if (nw % b == 0)
          yy++;
      }
      pair<int, int> ara[] = {{x + y, xy}, make_pair(x, xx), make_pair(y, yy)};
      sort(ara, ara + 3);
      reverse(ara, ara + 3);
      int xi = 0;
      long long sum = 0;
      for (int i = 0; i < 3; i++) {
        int nw = ara[i].second;
        int val = ara[i].first;
        while (nw--) {
          sum += 1ll * p[xi++] / 100 * val;
        }
      }
      if (sum >= k) {
        ans = mid + 1;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
