#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
int e,f,t,d;
while(cin>>e>>f>>t>>d&&e){
e=ceil((double)e/d),f=ceil((double)f/d);
if(t==3)
cout<<fixed<<setprecision(1)<<100*(double)e/(e+f)<<endl;
else{
double p=(double)t/6,q;
q=1-p;
cout<<fixed<<setprecision(1)<<100*(1-pow(q/p,e))/(1-pow(q/p,e+f))<<endl;
}
}
}
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
int e,f,t,d;
while(cin>>e>>f>>t>>d&&e){
e=ceil((double)e/d),f=ceil((double)f/d);
if(t==3)
cout<<fixed<<setprecision(1)<<100*(double)e/(e+f)<<endl;
else{
double p=(double)t/6,q;
q=1-p;
cout<<fixed<<setprecision(1)<<100*(1-pow(q/p,e))/(1-pow(q/p,e+f))<<endl;
}
}
}
Comments
Post a Comment