For this Question: Find the least subarray size <b>K</b> required from two arrays <b>A</b> and <b>B</b> (their positions don't matter), so that the product of the sum of those two subarrays is at least <b>S</b>. If no answer exists, print -1.The first line contains the integer T(the number of test cases).
Each test case contains 4 lines-
The first line contains 2 integers N and M (the respective sizes of the array)
The next line contains N integers (elements of the first array)
The next line contains M integers (elements of the second array)
The next line contain the integer S

Constraints:
1 <= T <= 10
1 <= N, M <= 10<sup>5</sup>
1 <= A<sub>i</sub> <= 10^4
1 <= B<sub>i</sub> <= 10^4
1 <= S <= 10<sup>16</sup>
Print the required minimum size K if a solution exists else print -1. 
Print answers for each test case in a new line.
Sample Input:
1
5 6 
1 2 3 4 6
2 4 5 4 9 3
120

Sample Output:
2 

Explanation:
We can choose a subarray [4, 6] of size 2 from A.
We can choose a subarray [4, 9] of size 2 from B.
Now sum from array A = 4+6 = 10
Sun from array B = 4+9 = 13
Product = 10 * 13 = 130 (which is greater than S)
It can be shown that jo subarray of size 1 can give appropriate results., I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define int long long
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using T = pair<int, int>;
typedef long double ld;
const int mod = 1e9 + 7;
const int INF = 1e9;

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <typename T>
// using ordered_set = tree
//     <T, null_type, less<T>, 
//     rb_tree_tag,tree_order_statistics_node_update>; 
// ordered_set<pair<int, int>> s;

void solve(){
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    vector<int> b(m);
    for(auto &i : a) cin >> i;
    for(auto &i : b) cin >> i;
    int p;
    cin >> p;
    int l = 1, r = min(n, m), ans = -1;
    while(l <= r){
        int mid = (l + r)/2;
        int sum1 = 0, sum2 = 0, cur = 0;
        for(int i = 0; i < n; i++){
            cur += a[i];
            if(i >= mid) cur -= a[i - mid];
            sum1 = max(sum1, cur);
        }
        cur = 0;
        for(int i = 0; i < m; i++){
            cur += b[i];
            if(i >= mid) cur -= b[i - mid];
            sum2 = max(sum2, cur);
        }
        int temp = sum1 * sum2;
        if(temp >= p){
            ans = mid;
            r = mid - 1;
        }
        else l = mid + 1;
    }
    cout << ans;
}

signed main(){
    fast
    int t = 1;
    cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
        if(i != t) cout << endl;
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?