Distributing the balls by m.ukai

#load "nums.cma"open Num
let rec f s a i b c=if b>0then Int b**/Int a*/Int c*/Int s+/f(-s)a(i+1)(b-1)(c*b/i)else Int 0;;while 1=1do
Scanf.scanf"%d %d "(fun a b->print_endline(string_of_num(f 1a 1b 1)))done

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

download

return to the top page