#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
long long Q;
long long N, arr[200001];
long long X, A, Y, B, K;
bool check(int num) {
  sort(arr, arr + N);
  int ind = N - 1;
  long long ans = 0;
  long long numAB = num / (A * B / gcd(A, B));
  while (numAB > 0) {
    ans += arr[ind] / 100 * (X + Y);
    numAB--;
    ind--;
  }
  numAB = num / (A * B / gcd(A, B));
  if (X < Y) {
    swap(X, Y);
    swap(A, B);
  }
  long long numA = num / A - numAB;
  while (numA > 0) {
    ans += arr[ind] / 100 * (X);
    numA--;
    ind--;
  }
  long long numB = num / B - numAB;
  while (numB > 0) {
    ans += arr[ind] / 100 * (Y);
    numB--;
    ind--;
  }
  return (ans >= K && N - 1 - ind <= num);
}
void solve() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> arr[i];
  cin >> X >> A >> Y >> B >> K;
  int low = -1, high = N + 1, mid;
  while (low + 1 < high) {
    mid = (low + high) / 2;
    if (check(mid))
      high = mid;
    else
      low = mid;
  }
  if (high == N + 1)
    cout << -1 << endl;
  else
    cout << high << endl;
}
int main() {
  cin >> Q;
  while (Q--) solve();
  return 0;
}
