UVa10491 Cows and Cars

 

 

#include<iostream>
#include<cstdio>
#include<algorithm>
int main(){
    double a,b,c;
    while(scanf("%lf%lf%lf",&a,&b,&c)==3)
      printf("%.5f\n",b*(a+b-1)/(a+b)/(a+b-c-1));
    return 0;
}

a/(a+b) 【开始选到牛的概率】 * b/(a+b-c-1) 【开始选到牛的情况下最后选到车的概率】 + b/(a+b) 【开始选到车的概率】 * (b-1)/(a+b-c-1) 【开始选到车的情况下最后选到车的概率】 
=b(a+b-1)/[(a+b)(a+b-c-1)]        by yhx

 

posted @ 2016-09-22 15:06  SilverNebula  阅读(105)  评论(0编辑  收藏  举报
AmazingCounters.com