描述:要么全选择牛,要么选择一辆车和p-1头牛,那么剩下n+m-p道门可以选择,求选择p道门以后要选择到车的概率
#include <cstdio> int main()
{
//freopen("in.txt","r",stdin);
int m,n,p;
while(scanf("%d%d%d",&m,&n,&p)!=EOF)
{
printf("%.5lf\n",(n*m*1.0+(n-1)*n*1.0)/(m+n)/(m+n-p-1));
}
return 0;
}
相关文章
- 01-22洛谷 P2868 [USACO07DEC]Sightseeing Cows G
- 01-22车辆-Cars
- 01-22Detecting Cars in a Video of TrDffic
- 01-22
- 01-22P3047 [USACO12FEB]附近的牛Nearby Cows
- 01-22POJ - 3186 Treats for the Cows(dp)
- 01-22P3419 [POI2005]SAM-Toy Cars
- 01-22(PAT详细题解)PAT甲级--Cars on Campus
- 01-22(模板)[USACO5.1]圈奶牛Fencing the Cows (二维凸包)
- 01-22poj3348 Cows