#include <bits/stdc++.h>
using namespace std;
bool is_possible(int m, long long k, long long p[], int n, int x, int a, int y,
                 int b) {
  if (a != b) {
    int first = 0;
    int second = 0;
    int third = 0;
    for (int i = 1; i <= m; i++) {
      if (i % a == 0 && i % b == 0)
        third++;
      else if (i % a == 0)
        first++;
      else if (i % b == 0)
        second++;
    }
    long long ans1 = 0;
    for (int i = 0; i < third; i++) {
      ans1 += ((p[i] * (x + y)) / 100);
    }
    for (int i = third; i <= third + first - 1; i++) {
      ans1 += ((p[i] * x) / 100);
    }
    for (int i = third + first; i <= third + first + second - 1; i++) {
      ans1 += ((p[i] * y) / 100);
    }
    long long ans2 = 0;
    for (int i = 0; i < third; i++) {
      ans2 += ((p[i] * (x + y)) / 100);
    }
    for (int i = third; i <= third + second - 1; i++) {
      ans2 += ((p[i] * y) / 100);
    }
    for (int i = third + second; i <= third + second + first - 1; i++) {
      ans2 += ((p[i] * x) / 100);
    }
    if (ans1 >= k || ans2 >= k) return true;
    return false;
  } else {
    long long ans1 = 0;
    int first = 0;
    for (int i = 1; i <= m; i++) {
      if (i % a == 0) first++;
    }
    for (int i = 0; i < first; i++) {
      ans1 += ((p[i] * (x + y)) / 100);
    }
    if (ans1 < k) return false;
    return true;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long aa[n];
    long long p[n];
    for (int i = 0; i < n; i++) {
      cin >> aa[i];
      p[i] = aa[i];
    }
    int x, a, y, b;
    cin >> x >> a >> y >> b;
    long long k;
    cin >> k;
    sort(p, p + n, greater<long long>());
    int l = 1;
    int h = n;
    int ans = -1;
    while (l <= h) {
      int m = l + (h - l) / 2;
      if (is_possible(m, k, p, n, x, a, y, b)) {
        ans = m;
        h = m - 1;
      } else {
        l = m + 1;
      }
    }
    cout << ans << endl;
  }
}
