#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using vi = vector<int>;   using pii = pair<int, int>;   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int tests;     cin >> tests;     for (int test = 0; test < tests; ++test) {       int n;       cin >> n;       vector<ll> a(n);       for (int i = 0; i < n; ++i) cin >> a[i];       ll x, y;       int fx, fy;       cin >> x >> fx >> y >> fy;       ll req;       cin >> req;       int lo = 1, hi = n + 1;       for (int i = 0; i < n; ++i) a[i] /= 100;       sort(a.begin(), a.end());       reverse(a.begin(), a.end());       while (lo < hi) {         int mid = (lo + hi) / 2;         vector<ll> c(mid);         for (int i = 0; i < mid; ++i) {           if (i % fx == fx - 1) c[i] += x;           if (i % fy == fy - 1) c[i] += y;         }         sort(c.begin(), c.end());         reverse(c.begin(), c.end());         ll sum = 0;         for (int i = 0; i < mid; ++i) sum += a[i] * c[i];         if (sum >= req)           hi = mid;         else           lo = mid + 1;       }       if (lo == n + 1) lo = -1;       cout << lo <<   n ;     }   }   