#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> aa(n);
    for (int i = 0; i < n; i++) cin >> aa[i];
    sort(aa.begin(), aa.end());
    long long x, a, y, b, k;
    cin >> x >> a >> y >> b >> k;
    k *= 100;
    int l = 1, r = n, ans = -1;
    while (l <= r) {
      int m = (l + r) >> 1;
      vector<long long> v;
      for (int i = 1; i <= m; i++) {
        long long val = 0;
        if (i % a == 0) val += x;
        if (i % b == 0) val += y;
        if (val) v.push_back(val);
      }
      sort(v.begin(), v.end());
      long long res = 0;
      for (int i = (int)v.size() - 1, j = n - 1; i >= 0; i--, j--) {
        res += v[i] * aa[j];
      }
      if (res >= k)
        ans = m, r = m - 1;
      else
        l = m + 1;
    }
    cout << ans << endl;
  }
  return 0;
}
