# HDU 4624 【期望】

p(i)$p(i)$为 i 次操作后还有白球的概率，则答案为

i=0p[i]

import java.util.Scanner;
import java.io.*;
import java.math.BigDecimal;

public class Main
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
long [][][]f = new long[55][2][2600];
BigDecimal []E = new BigDecimal[55];
for (int i = 0;i < 55;i ++)
for (int j = 0;j < 2;j ++)
for (int k = 0;k < 2600;k ++) f[i][j][k] = new Long(0);
for (int i = 0;i < 55;i ++) E[i] = new BigDecimal("0");
f[0][0][0] = (long)1;
for (int i = 0;i <= 50;i ++)
for (int j = 0;j <= i * (i + 1) / 2;j ++)
for (int k = i + 1;k <= 50;k ++)
{
f[k][0][j + (k - i) * (k - i - 1) / 2] += f[i][1][j];
f[k][1][j + (k - i) * (k - i - 1) / 2] += f[i][0][j];
}
for (int i = 1;i <= 50;i ++)
for (int j = 0;j <= i;j ++)
for (int k = 0;k <= j * (j + 1) / 2;k ++)
{
if ((k + (i - j) * (i - j + 1) / 2) / (i * (i + 1) / 2) == 1) continue;
BigDecimal p = new BigDecimal("1.0"),a = new BigDecimal(k + (i - j + 1) * (i - j) / 2),b = new BigDecimal (i * (i + 1) / 2);
p = p.subtract(a.divide(b,50,BigDecimal.ROUND_HALF_UP));
BigDecimal temp = new BigDecimal(f[j][1][k] - f[j][0][k]);
}