#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 500031;
int tests, n, p[N];
vector<int> order;
long long pref[N];
long long x, y, a, b, cx, cy, cboth;
long long k, win;
long long solver() {
  long long ret = 0;
  ret = pref[cboth] * (x + y) + (pref[cboth + cx] - pref[cboth]) * x +
        (pref[cboth + cx + cy] - pref[cboth + cx]) * y;
  ret = max(ret, pref[cboth] * (x + y) + (pref[cboth + cy] - pref[cboth]) * y +
                     (pref[cboth + cx + cy] - pref[cboth + cy]) * x);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> tests;
  for (; tests; --tests) {
    cin >> n;
    order.clear();
    for (int i = 1; i <= n; i++) {
      cin >> p[i];
      p[i] /= 100;
      order.push_back(p[i]);
    }
    sort(order.begin(), order.end());
    reverse(order.begin(), order.end());
    for (int i = 1; i <= n; i++) {
      pref[i] = pref[i - 1] + order[i - 1];
    }
    cin >> x >> a;
    cin >> y >> b;
    cin >> k;
    win = -1;
    cx = 0;
    cy = 0;
    cboth = 0;
    for (int i = 1; i <= n; i++) {
      if (i % a == 0 && i % b == 0) {
        cboth++;
      } else if (i % a == 0) {
        cx++;
      } else if (i % b == 0) {
        cy++;
      }
      long long here = solver();
      if (here >= k) {
        win = i;
        break;
      }
    }
    cout << win << endl;
  }
  return 0;
}
