#include <bits/stdc++.h>
using namespace std;
const long long dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const long long dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};
long long n;
long long a[1000000];
long long aa, bb, xx, yy, k;
bool isItPossible(long long till) {
  set<long long> onlyA, onlyB, both;
  long long x = aa;
  while (x <= till) onlyA.insert(x), x += aa;
  x = bb;
  while (x <= till) {
    if (onlyA.count(x)) {
      both.insert(x);
      onlyA.erase(x);
    } else
      onlyB.insert(x);
    x += bb;
  }
  long long mx = 0;
  long long ind = 1;
  for (auto x : both) mx += (xx + yy) * a[ind++] / 100;
  if (xx > yy) {
    for (auto x : onlyA) mx += xx * a[ind++] / 100;
    for (auto x : onlyB) mx += yy * a[ind++] / 100;
  } else {
    for (auto x : onlyB) mx += yy * a[ind++] / 100;
    for (auto x : onlyA) mx += xx * a[ind++] / 100;
  }
  cerr << mx << " " << k << '\n';
  return mx >= k;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long test = 1;
  cin >> test;
  while (test--) {
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1, greater<long long>());
    cin >> xx >> aa;
    cin >> yy >> bb;
    cin >> k;
    long long left = 1, right = n;
    while (left < right) {
      long long mid = (left + right) / 2;
      if (isItPossible(mid))
        right = mid;
      else
        left = mid + 1;
    }
    if (isItPossible(n))
      cout << left << '\n';
    else
      cout << -1 << '\n';
  }
  return 0;
}
