#include <bits/stdc++.h>
using namespace std;
long long q, n;
long long p[200008];
long long x, a;
long long y, b;
long long k;
long long numa, numb, numLCM;
long long LCM;
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
bool check(long long mid) {
  numa = mid / a - mid / LCM;
  numb = mid / b - mid / LCM;
  numLCM = mid / LCM;
  long long ans = 0;
  for (long long i = 1; i <= mid; i++) {
    if (numLCM) {
      numLCM--;
      ans += p[i] * (x + y);
    } else if (numa) {
      numa--;
      ans += p[i] * x;
    } else if (numb) {
      numb--;
      ans += p[i] * y;
    } else {
      break;
    }
  }
  return (ans >= k);
}
bool cmp(long long a, long long b) { return a > b; }
void solve() {
  long long l = 1, r = n;
  long long ans = 1e18;
  while (l <= r) {
    long long mid = l + r >> 1;
    if (check(mid)) {
      ans = min(mid, ans);
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  cout << (ans == 1e18 ? -1 : ans) << endl;
}
signed main() {
  scanf("%lld", &q);
  while (q--) {
    scanf("%lld", &n);
    for (long long i = 1; i <= n; i++) scanf("%lld", &p[i]), p[i] /= 100;
    scanf("%lld%lld", &x, &a);
    scanf("%lld%lld", &y, &b);
    scanf("%lld", &k);
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    LCM = a * b / gcd(a, b);
    sort(p + 1, p + 1 + n, cmp);
    solve();
  }
  return 0;
}
