Help Ramu-problem in fundamentals

sir i’ve failed only the 0 test case.rest all are passed.
how can i improve?

#include
using namespace std;

int main(){

int T;
int c1,c2,c3,c4,m,n,r_cost=0,c_cost=0,cost=0,i;
cin>>T;
for(int j=0;j<T;j++){
    cin>>c1>>c2>>c3>>c4>>n>>m;
    int ric[n],cab[m];
    for(i=0;i<n;i++){
        cin>>ric[i];
        if(ric[i]>0)
            r_cost+=min(ric[i]*c1,c2);
    }
    if(r_cost>0)
        cost=min(r_cost,c3);
    for(i=0;i<m;i++){
        cin>>cab[i];
        if(cab[i]>0)
            c_cost+=min(cab[i]*c1,c2);
    }
    if(c_cost>0)
        cost+=min(c_cost,c3);
    cout<<min(cost,c4)<<endl;

}

return 0;

}

@aryan2909 the last code you submitted is showing all test passed, so what doubt you are facing?

Hm Now it’s fine sir
I made some changes in the code.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.