#C10593. Unique Bookshelf Configurations
Unique Bookshelf Configurations
Unique Bookshelf Configurations
You are given a bookshelf with N rows and M columns. Each cell of the bookshelf holds a unique book. The task is to determine the number of unique configurations in which the books can be arranged on the shelf.
In mathematical terms, if the total number of books is \(N \times M\), then the number of unique arrangements is given by the factorial of \(N \times M\), i.e., \[ \prod_{i=1}^{N\times M} i = (N\times M)! \]
You need to write a program that reads the two integers N and M from standard input, calculates the factorial of their product and outputs the result to standard output.
inputFormat
The input consists of two space-separated integers N and M (\(1 \leq N, M \leq 100\)). These integers represent the number of rows and columns of the bookshelf, respectively.
Input is provided via standard input (stdin).
outputFormat
The output should be a single integer representing the number of unique configurations (i.e., \((N\times M)!\)). The output is printed to standard output (stdout).
## sample2 2
24
</p>