Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- int main()
- {
- //freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- int cow,car,show,i,j,k,door;
- double pro1,pro2;
- while(cin>>cow>>car>>show)
- {
- door=cow+car;
- pro1=(cow/(double)door)*((double)(car)/(door-show-1));
- pro2=(car/(double)door)*((double)(car-1)/(door-show-1));
- double ans=pro1+pro2;
- printf("%.5lf\n",ans);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement