Distributing the balls by tails

#!perl -lp
use Math'BigInt;map$a[$_]=Math'BigInt'bzero,!/ /..$';$a[$'-1]+=$';map{($a[$_-1]*=$'-$_+1)+=$a[$_]*$_}1..$' for 2..$`;$_=$a[0]

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page