Help me in solving MOONSOON problem

My issue

I am getting wrong answer at test case 2 , what to do . Please help

My code

#include <bits/stdc++.h>

using namespace std;

int main(){
    int t;
    cin>>t;
    while(t--){
        int temp,n,m,h;
        cin>>n>>m>>h;
        vector<long long int>car;
        vector<long long int>fuel;
        for(int i=0;i<n;i++){
            cin>>temp;
            car.push_back(temp);
        }
        for(int i=0;i<m;i++){
            cin>>temp;
            fuel.push_back(temp);
        }
        sort(car.begin(),car.end(),greater<int>());
        sort(fuel.begin(),fuel.end(),greater<int>());
        int ans=0;
        int i=0;
        int j=0;
        while(i<n && j<m){
            ans=ans+min(car[i++],h*fuel[j++]);
        }
        cout<<ans<<endl;
    }
    return 0;
}

Problem Link: MOONSOON Problem - CodeChef

The problem is with int and long long data type. Just change all the int variables to long long int and try. (“long long int temp, n, m, h”). I think the issue will be there when you try to multiply int and long long variables. I had the same issue second test case failed. I just changed all the variables to long long and it worked.