#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int p[N], n, a, b, x, y, i, j, T_T, c[N], id[N], l, r, mid, ans;
long long m;
bool cmp(int a, int b) { return c[a] > c[b]; }
bool check(int x, long long res = 0) {
  for (int i = 1; i <= x; ++i) id[i] = i;
  sort(id + 1, id + x + 1, cmp);
  for (int i = 1; i <= x; ++i) res += 1LL * c[id[i]] * p[i] / 100;
  return res >= m;
}
int main() {
  for (scanf("%d", &T_T); T_T--;) {
    for (scanf("%d", &n), i = 1; i <= n; ++i) scanf("%d", p + i);
    sort(p + 1, p + n + 1, greater<int>());
    for (scanf("%d%d%d%d", &x, &a, &y, &b), i = a; i <= n; i += a) c[i] += x;
    for (i = b; i <= n; i += b) c[i] += y;
    for (scanf("%lld", &m), ans = -1, l = 1, r = n; l <= r;)
      check(mid = l + r >> 1) ? r = (ans = mid) - 1 : l = mid + 1;
    for (i = 1; i <= n; ++i) c[i] = 0;
    printf("%d\n", ans);
  }
}
