#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      a[i] /= 100;
    }
    sort(a, a + n, greater<int>());
    int id1, id2, id3;
    id1 = id2 = id3 = 0;
    int x, p, y, q;
    cin >> x >> p;
    cin >> y >> q;
    long long int w;
    cin >> w;
    if (x < y) {
      swap(x, y);
      swap(p, q);
    }
    x -= y;
    long long int u = 0;
    int i = 0;
    for (i = 1; i <= n && u < w; i++) {
      if (i % p == 0 || i % q == 0) {
        u += (a[id1++] * y);
      }
      if (i % p == 0) u += (a[id2++] * x);
      if (i % p == 0 && i % q == 0) u += (a[id3++] * y);
    }
    if (u >= w)
      cout << i - 1 << endl;
    else
      cout << "-1" << endl;
  }
}
