#include<stdio.h>
int main(){
int m;
int M,X,Y,Z ;
float way;
scanf("%d",&m);
while(m--){
scanf("%d%d%d%d",&M,&X,&Y,&Z);
M=(M*X)/(Y-X);
way=Z*M;
printf("%.2f\n",way);
}
return 0;
}
int main(){
int m;
int M,X,Y,Z ;
float way;
scanf("%d",&m);
while(m--){
scanf("%d%d%d%d",&M,&X,&Y,&Z);
M=(M*X)/(Y-X);
way=Z*M;
printf("%.2f\n",way);
}
return 0;
}