#include

using namespace std;

int main(){

int t;

cin>>t;

while(t–){

long long n,r;

cin>>n>>r;

long long a[n],b[n],tension=0;

for(long long i=0;i<n;i++){

cin>>a[i];

}

for(long long i=0;i<n;i++){

cin>>b[i];

}

for(long long i=0;i<n;i++){

if(i==0){

tension+=b[i];

}else{

tension+=b[i];

long long diff = (a[i]-a[i-1])*r;

tension = tension -diff;

}

}

cout<<tension<<"\n";

}

}

i am getting correct output but wrong answer in chodechef compilier can anyone help?