///有c種不同顏色的巧克力,一個個的取,當發現有相同的顏色的就吃掉,去了n個後,到最後還剩m個的概率 ///dp[i][j]表示取了i個還剩j個的概率 ///當m+n為奇時,概率為0 # include# include # include # include using namespace std; double dp[1010][1010]; int main() { int i,j,n,m,c; while(~scanf("%d",&c),c) { scanf("%d%d",&n,&m); if(m>c||m>n||(n+m)%2) printf("0.000\n"); else { if(n>1000) n=1000+n%2; memset(dp,0,sizeof(dp)); dp[0][0]=1; for(i=1;i<=n;i++) { dp[i][0]=dp[i-1][1]/c; dp[i][c]=dp[i-1][c-1]/c; for(j=1;j