#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int maxN = 5e6 + 5;
int x, y, a, b;
long long arr[maxN];
long long k;
int n, q;
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long c = a % b;
    a = b;
    b = c;
  }
  return a;
}
long long gcm(long long a, long long b) { return a * b / gcd(a, b); }
bool can(int days) {
  long long z = gcm(a, b);
  int ile_ab = days / z;
  int ile_a = days / a - ile_ab;
  int ile_b = days / b - ile_ab;
  long long ans = 0;
  for (int i = (0); i <= ((ile_ab)-1); ++i) {
    ans += (x + y) * arr[i];
  }
  for (int i = (ile_ab); i <= (ile_ab + ile_a - 1); ++i) {
    ans += x * arr[i];
  }
  for (int i = (ile_ab + ile_a); i <= (ile_ab + ile_a + ile_b - 1); ++i) {
    ans += y * arr[i];
  }
  return ans >= k;
}
int bins() {
  int l = 1, r = n;
  while (l < r) {
    int m = (l + r) / 2;
    if (can(m)) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  return r;
}
int main() {
  cin >> q;
  for (int _ = (0); _ <= ((q)-1); ++_) {
    cin >> n;
    for (int i = (0); i <= ((n)-1); ++i) {
      cin >> arr[i];
      arr[i] /= 100;
    }
    sort(arr, arr + n, std::greater<long long>());
    cin >> x >> a;
    cin >> y >> b;
    cin >> k;
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    int z = bins();
    if (!can(z))
      cout << -1 << endl;
    else
      cout << z << endl;
  }
  return 0;
}
