import Data.Array
memoized_binomial a b = arr ! (a, b) where
arr = array ((0, 0), (size, size)) [((x, y), inner (x, y) size) | x <- [0..size], y <- [0..size]]
where inner (x, y) size
| x == 0 && y == 0 = 0
| x == 0 || y == 0 = 1
| otherwise = arr
! (x
- 1, y
) + arr
! (x
, y
- 1)
aW1wb3J0IERhdGEuQXJyYXkKCm1lbW9pemVkX2Jpbm9taWFsIDo6IEludGVnZXIgLT4gSW50ZWdlciAtPiBJbnRlZ2VyCm1lbW9pemVkX2Jpbm9taWFsIGEgYiA9IGFyciAhIChhLCBiKSB3aGVyZQogIGFyciA9IGFycmF5ICgoMCwgMCksIChzaXplLCBzaXplKSkgWygoeCwgeSksIGlubmVyICh4LCB5KSBzaXplKSB8IHggPC0gWzAuLnNpemVdLCB5IDwtIFswLi5zaXplXV0gCiAgICB3aGVyZSBpbm5lciAoeCwgeSkgc2l6ZQogICAgICAgICAgICB8IHggPT0gMCAmJiB5ID09IDAgPSAwCiAgICAgICAgICAgIHwgeCA9PSAwIHx8IHkgPT0gMCA9IDEKICAgICAgICAgICAgfCBvdGhlcndpc2UgPSBhcnIgISAoeCAtIDEsIHkpICsgYXJyICEgKHgsIHkgLSAxKQogICAgICAgICAgc2l6ZSA9IG1heCBhIGIKCm1haW4gPSBwdXRTdHJMbiAkIHNob3cgJCBtZW1vaXplZF9iaW5vbWlhbCA4MDAgODAw