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;
}