Skip to main content
added 413 characters in body
Source Link
FryAmTheEggman
  • 17.5k
  • 3
  • 40
  • 97

Pyth, 8

/.cyQQhQ

Try it online or run the Test Suite

Explanation

/.cyQQhQ   ## implicit: Q = eval(input())
/     hQ   ## integer division by (Q + 1)
 .c        ## nCr
   yQ      ## use Q * 2 as n
     Q     ## use Q as r

Pyth, 8

/.cyQQhQ

Try it online

Pyth, 8

/.cyQQhQ

Try it online or run the Test Suite

Explanation

/.cyQQhQ   ## implicit: Q = eval(input())
/     hQ   ## integer division by (Q + 1)
 .c        ## nCr
   yQ      ## use Q * 2 as n
     Q     ## use Q as r
Source Link
FryAmTheEggman
  • 17.5k
  • 3
  • 40
  • 97

Pyth, 8

/.cyQQhQ

Try it online