#include <bits/stdc++.h>
using namespace std;
int T, n;
long long p[200005];
int an, bn, abn;
int x, a, y, b;
long long k;
bool cmp(const int &a, const int &b) { return a > b; }
int main() {
  cin >> T;
  while (T--) {
    an = 0;
    bn = 0;
    abn = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> p[i];
    }
    cin >> x >> a >> y >> b;
    cin >> k;
    if (x > y) {
      int t = x;
      x = y, y = t;
      t = a, a = b, b = t;
    }
    sort(p + 1, p + n + 1, cmp);
    int sum = 0;
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
      p[i] = p[i] + p[i - 1];
    }
    for (int i = 1; i <= n; i++) {
      if (i % a == 0 && i % b == 0) {
        abn++;
        sum++;
      } else if (i % a == 0)
        an++, sum++;
      else if (i % b == 0)
        bn++, sum++;
      ans = p[abn] * (x + y) + y * (p[bn + abn] - p[abn]) +
            x * (p[an + bn + abn] - p[bn + abn]);
      ans /= 100;
      if (ans >= k) {
        cout << i << endl;
        break;
      }
      sum = 0;
    }
    if (!sum) cout << -1 << endl;
  }
  return 0;
}
