#K62262. Palette Combinations Calculator

    ID: 31493 Type: Default 1000ms 256MiB

Palette Combinations Calculator

Palette Combinations Calculator

You are given two integers n and k. Your task is to compute the number of ways to choose k different colors from a palette of n distinct colors. The answer is given by the combination formula:

(nk)=n!k!(nk)!\binom{n}{k} = \frac{n!}{k!(n-k)!}

For example, when n = 5 and k = 3, the answer is 10. Your solution must read the input from the standard input (stdin) and print the result to the standard output (stdout).

inputFormat

The input consists of a single line containing two space-separated integers n and k, where:

  • n represents the total number of distinct colors.
  • k represents the number of colors to select.

outputFormat

Output a single integer, which is the value of \(\binom{n}{k}\), representing the number of combinations.

## sample
5 3
10