#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 7;
const long long mod = 998244353;
long long gcd(int x, int y) {
  if (!y)
    return (long long)x;
  else
    return (long long)gcd(y, x % y);
}
bool cmp(long long x, long long y) { return x > y; }
long long arr[N];
long long n, x, a, y, b;
long long k;
bool check(long long m) {
  if (m == 0) {
    if (k > 0)
      return false;
    else
      return true;
  }
  long long sum = 0, cnt = 0;
  long long g = (long long)a * (long long)b / gcd(a, b);
  long long cnt1 = m / a, cnt2 = m / b, cnt3 = m / g;
  for (int i = 1; i <= cnt3; ++i) {
    sum += arr[i] * x / 100 + arr[i] * y / 100;
  }
  cnt1 -= cnt3, cnt2 -= cnt3;
  int i = cnt3 + 1, p = cnt3 + 1;
  cnt = sum;
  for (int j = 1; j <= cnt2; ++j, ++p) {
    cnt += arr[p] * y / 100;
  }
  for (int j = 1; j <= cnt1; ++j, ++p) {
    cnt += arr[p] * x / 100;
  }
  for (int j = 1; j <= cnt1; ++i, ++j) {
    sum += arr[i] * x / 100;
  }
  for (int j = 1; j <= cnt2; ++j, ++i) {
    sum += arr[i] * y / 100;
  }
  if (sum >= k || cnt >= k)
    return true;
  else
    return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> arr[i];
    }
    cin >> x >> a >> y >> b >> k;
    sort(arr + 1, arr + n + 1, cmp);
    long long l = 0, r = n, ans = -1, flag = 0;
    while (l <= r) {
      long long mid = (l + r) >> 1;
      if (check(mid)) {
        ans = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    cout << ans << endl;
  }
  return 0;
}
