c = {}
function cf(n,m)
if(n == m) then
c[n][m] = 1
elseif(n < m) then
c[n][m] = 0
elseif(m == 0) then
c[n][m] = 1
else
if(c[n-1] == nil) then
c[n-1] = {}
end
if(c[n-1][m-1] == nil) then
c[n-1][m-1] = cf(n-1, m-1)
end
if(c[n-1][m] == nil) then
c[n-1][m] = cf(n-1, m)
end
if(c[n] == nil) then
c[n] = {}
end
c[n][m] = c[n-1][ m-1] + c[n-1][m]
end
return c[n][m]
end
print(cf(10,3))