Advertisement
Farjana_akter

Untitled

Jul 16th, 2020
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1.  
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. typedef long long int ll;
  6.  
  7.  
  8. int main()
  9. {
  10. //freopen("input.txt","r",stdin);
  11. //freopen("output.txt","w",stdout);
  12. int cow,car,show,i,j,k,door;
  13. double pro1,pro2;
  14. while(cin>>cow>>car>>show)
  15. {
  16. door=cow+car;
  17. pro1=(cow/(double)door)*((double)(car)/(door-show-1));
  18. pro2=(car/(double)door)*((double)(car-1)/(door-show-1));
  19. double ans=pro1+pro2;
  20. printf("%.5lf\n",ans);
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement