#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  int n;
  int prices[200010];
  int x;
  int y;
  int a;
  int b;
  long long k;
  int hold_1;
  int hold_2;
  int ab;
  int high;
  int low;
  int mid;
  int best;
  long long count;
  int i;
  int j;
  scanf("%d", &q);
  for (i = 0; i < q; i++) {
    scanf("%d", &n);
    for (j = 0; j < n; j++) {
      scanf("%d", &prices[j]);
    }
    scanf("%d", &x);
    scanf("%d", &a);
    scanf("%d", &y);
    scanf("%d", &b);
    scanf("%lld", &k);
    sort(prices, prices + n, greater<int>());
    if (y > x) {
      hold_1 = x;
      hold_2 = a;
      x = y;
      a = b;
      y = hold_1;
      b = hold_2;
    }
    ab = 200010;
    for (j = 1; j < n + 1; j++) {
      if (j % a == 0 && j % b == 0) {
        ab = j;
        break;
      }
    }
    low = 1;
    high = n;
    best = -1;
    while (low <= high) {
      mid = (low + high) / 2;
      count = 0;
      for (j = 0; j < mid / ab; j++) {
        count += (long long)prices[j] * (x + y) / 100;
      }
      for (j = mid / ab; j < mid / a; j++) {
        count += (long long)prices[j] * x / 100;
      }
      for (j = mid / a; j < mid / b + mid / a - mid / ab; j++) {
        count += (long long)prices[j] * y / 100;
      }
      if (count >= k) {
        high = mid - 1;
        best = mid;
      } else {
        low = mid + 1;
      }
    }
    printf("%d\n", best);
  }
  return 0;
}
