#include <bits/stdc++.h>
using namespace std;
int gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return (long long)a * (long long)b / g;
}
long long maxSum(int *arr, int size, int n, int a, int b, long long c, int p1,
                 int p2, int p3) {
  int n3 = 0;
  int n2 = 0;
  int n1 = 0;
  while (n) {
    if (n % a == 0 && n % b == 0) {
      n3++;
    } else if (n % b == 0) {
      n2++;
    } else if (n % a == 0) {
      n1++;
    }
    n--;
  }
  int i = size - 1;
  long long s = 0;
  while (n3--) {
    s += p3 * (arr[i--] / 100);
  }
  while (n2--) {
    s += p2 * (arr[i--] / 100);
  }
  while (n1--) {
    s += p1 * (arr[i--] / 100);
  }
  return s;
}
int minCoins(int *arr, int size, int si, int ei, long long k, int a, int b,
             int c, int p1, int p2, int p3) {
  if (si == ei) {
    return si;
  }
  int mid = (si + ei) / 2;
  long long s = maxSum(arr, size, mid, a, b, c, p1, p2, p3);
  if (s >= k) {
    return minCoins(arr, size, si, mid, k, a, b, c, p1, p2, p3);
  } else {
    return minCoins(arr, size, mid + 1, ei, k, a, b, c, p1, p2, p3);
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    int p1, a;
    cin >> p1 >> a;
    int p2, b;
    cin >> p2 >> b;
    long long k;
    cin >> k;
    long long c = lcm(a, b);
    int p3 = p1 + p2;
    sort(arr, arr + n);
    long long s = maxSum(arr, n, n, a, b, c, p1, p2, p3);
    if (p2 < p1) {
      s = maxSum(arr, n, n, b, a, c, p2, p1, p3);
    }
    if (s < k) {
      cout << -1 << endl;
    } else {
      if (p2 > p1)
        cout << minCoins(arr, n, 1, n, k, a, b, c, p1, p2, p3) << endl;
      else
        cout << minCoins(arr, n, 1, n, k, b, a, c, p2, p1, p3) << endl;
    }
  }
  return 0;
}
