>>95
(n+r)!/n!/r! = n+r C r
と変形して、あとはKnuthのTAOCPに載ってるオーバーフローしにくいやり方で組み合わせを計算してみよう
https://stackoverflow.com/questions/1838368/calculating-the-amount-of-combinations/1838732#1838732