#include
using namespace std;
int main() {
int times;
cin>>times;
for(int i=0;i<times;i++){
int c1,c2,c3,c4;
cin>>c1>>c2>>c3>>c4;
int r_n,c_m;
cin>>r_n>>c_m;
int ricks[r_n],cabs[c_m] ;
int ricks_sum=0,cabs_sum=0;
for(int rick=0;rick<r_n;rick++){
cin>>ricks[rick];
ricks_sum = ricks_sum + min(c1ricks[rick],c2);
}
for(int cab=0;cab<c_m;cab++){
cin>>cabs[cab];
cabs_sum+=cabs_sum+min(c1cabs[cab],c2);
}
int min_ricks=min(ricks_sum,c3);
int min_cabs=min(cabs_sum,c3);
int min_sum=min(min_cabs+min_ricks,c4);
cout<<min_sum;
}
return 0;
}
My code doesnt pass the tests