Calculate X and Y from the equations X + 2 Y = N and 2 X + Y == M
X = N - ( N + M ) // 3 NEW_LINE Y = M - ( N + M ) // 3 NEW_LINE if X < 0 or Y < 0 : NEW_LINE INDENT return 0 NEW_LINE DEDENT return nck ( X + Y , Y ) NEW_LINE