Ways 1

https://www.hackerrank.com/contests/codenection-2021-open-category-finals/challenges/ways-1-1

Question

There is a wire of integer length lying flat. We will cut this wire at 11 integer positions to divide it into 12 smaller wires. Here, each of the 12 resulting wires must have a positive integer length. Find the number of ways to do this division. It can be proved that the answer is less than 2632^{63}.

Input Format

L

Constraints

12≤L≤20012 \le L \le 200

Output Format

A single integer, the number of ways to divide the wire.

Sample Inputs:

Input

12

Output

1

Solution - Stars and Bars Problem

A typical stars and bars problem. A simple combinatorial calculation (n−111)\binom{n-1}{11} is enough to suffice the conditions.

Here's the solution:

from math import comb
print(comb(int(input())-1, 11))

Last updated