title: Optimizing calculating combination and avoiding overflows
body: <p>I am solving a programming problem which is stuck at calculating <code>nCr</code> efficiently and at the same time avoiding overflows. I have made the following trivial simplification but am just curious about if there are any more sophisticated simplifications available out there.</p>
  
  <p><code>(n)!/(n-k)!*k! = n*(n-1)*.....*(max(n-k+1, k))/(min(n-k, k-1))</code></p>
  
  <p>Can there be any more simplification possible considering different cases for k as even or odd, just suggesting a way.</p>
  
  <p>Any comment is appreciated.</p>