#include <bits/stdc++.h>
using namespace std;
long long gcd(int a, int b) {
  if (a < b) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> prices(n, 0);
    for (int i = 0; i < n; i++) cin >> prices[i];
    sort(prices.begin(), prices.end(), greater<long long>());
    vector<long long> presum(n, 0);
    presum[0] = prices[0];
    for (int i = 1; i < n; i++) presum[i] = prices[i] + presum[i - 1];
    long long x, a;
    cin >> x >> a;
    long long y, b;
    cin >> y >> b;
    long long k;
    cin >> k;
    long long lcm = a * b / gcd(a, b);
    long long total = 0;
    int lcmc = 0;
    int cx = 0;
    int cy = 0;
    int i = 1;
    for (; i <= n; i++) {
      if (i % lcm == 0)
        lcmc++;
      else if (i % a == 0)
        cx++;
      else if (i % b == 0)
        cy++;
      else
        continue;
      int lim = lcmc;
      long long fl = (lim == 0) ? 0 : presum[lim - 1];
      total = fl * (x + y) / 100;
      int mxy = (x > y) ? cx : cy;
      int pxy = (x > y) ? x : y;
      int lxy = (x <= y) ? cx : cy;
      int plxy = (x <= y) ? x : y;
      int lim2 = lim + mxy;
      long long sl = (lim2 == 0) ? 0 : presum[lim2 - 1];
      total += (sl - fl) * pxy / 100;
      int lim3 = lim2 + lxy;
      total += (presum[lim3 - 1] - sl) * plxy / 100;
      if (total >= k) break;
    }
    if (total < k)
      cout << -1 << endl;
    else
      cout << i << endl;
  }
}
