Function to find the minimum count of paths from top left to bottom right by placing K 1 s in the matrix
function countPath ( N , M , K ) { var answer ; if ( K >= 2 ) answer = 0 ; else if ( K == 0 ) answer = ncr ( N + M - 2 , N - 1 ) ; else {