Discussion About Help Ramu

This is Discussion thread about Help Ramu

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t>0)
{
int cost_c=0,cost_r=0,total_cost=0,fcost_r=0,fcost_c=0,ftotal_cost=0;
int c1=sc.nextInt();
int c2=sc.nextInt();
int c3=sc.nextInt();
int c4=sc.nextInt();
sc.nextLine();
int nr=sc.nextInt();
int nc=sc.nextInt();
sc.nextLine();
int[] a=new int[nr];
for(int i=0;i<nr;i++)
{
a[i]=sc.nextInt();
}
int[] b=new int[nc];
for(int i=0;i<nc;i++)
{
b[i]=sc.nextInt();
}
for(int i=0;i<nr;i++)
{
cost_r+= Math.min(a[i]*c1,c2);
}
fcost_r=Math.min(cost_r,c3);
//System.out.println(fcost_r);
for(int i=0;i<nc;i++)
{
cost_c+= Math.min(b[i]*c1,c2);
}
fcost_c=Math.min(cost_c,c3);
//System.out.println(fcost_c);
total_cost=fcost_r+fcost_c;
ftotal_cost=Math.min(total_cost,c4);
System.out.println(ftotal_cost);
t–;
}
}
}