#include <bits/stdc++.h>
using namespace std;
int mygcd(int a, int b) {
  if (!b) return a;
  return mygcd(b, a % b);
}
int arr[200005];
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    sort(arr, arr + n);
    reverse(arr, arr + n);
    int x, a, y, b;
    long long k;
    scanf("%d%d%d%d%lld", &x, &a, &y, &b, &k);
    if (x < y) {
      swap(x, y);
      swap(a, b);
    }
    int s = 1, e = n, ans = -1;
    while (s <= e) {
      int m = (s + e) / 2;
      int nx = m / a, ny = m / b;
      long long xy = ((long long)a * b) / mygcd(a, b);
      int nxy = m / xy;
      nx -= nxy;
      ny -= nxy;
      long long sumdono = 0ll;
      for (int i = 0; i < nxy; i++) {
        long long val = arr[i] / 100ll;
        val *= (x + y);
        sumdono += val;
      }
      for (int i = nxy; i < nxy + nx; i++) {
        long long val = arr[i] / 100ll;
        val *= (x);
        sumdono += val;
      }
      for (int i = nxy + nx; i < nxy + nx + ny; i++) {
        long long val = arr[i] / 100ll;
        val *= (y);
        sumdono += val;
      }
      if (sumdono >= k) {
        ans = m;
        e = m - 1;
      } else
        s = m + 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
