For this Question: Sara has two types of apples that have some sweetness level. She has N apples of the first type which costs her P rupees each and M apples of the second type which costs her Q rupees each. She wants to pick apples in such a way that the total sum of sweetness level is equal to or more than X and the total cost is minimum.The first line of input contains 5 integers N, M, P, Q, X separated by spaces. The second line of input contains N Space- separated integers depicting the sweetness level of the first type of apples. The last line of input contains M space- separated integers depicting the sweetness level of the second type of apples.

Sample Input:-
1 <= N, M <= 50000
1 <= X, P, Q <= 1000000000
1 <= Sweetness <= 100000Print the minimum cost required if it is possible to make total sweetness more than X else print -1.Sample Input:-
5 5 1 2 16
1 2 3 4 5
3 2 1 8 7

Sample Output:-
4

Explanation:-
From first type:- 4, 5
From second type:- 8

Sample Input:-
5 5 1 2 100
1 2 3 4 5
1 2 3 4 5

Sample Output:-
-1, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int t;
    t=1;
    while(t--){
        int n,m;
        int l,g,x;
        cin>>n>>m>>l>>g>>x;
        vector<int> a,b;
        int q;
        for(int i=0;i<n;i++){
        cin>>  q;
            
                b.emplace_back(q);
        }
        for(int i=0;i<m;i++){
            cin>>q;
            a.emplace_back(q);
        }
        sort(a.begin(),a.end());
        sort(b.begin(),b.end());
        reverse(a.begin(),a.end());
        reverse(b.begin(),b.end());
        int sum=0;
        int ans=0;
        n=a.size();
       int p=b.size();
        vector<int> prea(n+1),preb(p+1);
        prea[0]=0;
        preb[0]=0;
        for(int i=1;i<=n;i++){
        sum+=a[i-1];
        prea[i]=sum;
        }
        sum=0;
        for(int i=1;i<=p;i++){
        sum+=b[i-1];
        preb[i]=sum;
        }
        ans=LLONG_MAX;
          vector<int>::iterator it;
       // int x;
        for(int i=0;i<=n;i++){
        //    cout<<prea[i]<<" ";
            if(x>=prea[i]){
            it=lower_bound(preb.begin(),preb.end(),x-prea[i]);
            
            if(it!=preb.end()){
               // cout<<*it<<" 2343";
                ans=min(ans,(it-preb.begin())*l+g*i);
            }
            }
            else{
                ans=min(g*i,ans);
            }
        }
        if(ans==LLONG_MAX){cout<<-1<<endl;}
        else{
            cout<<ans<<endl;
        }
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?