#K35807. Circular Permutations

    ID: 25613 Type: Default 1000ms 256MiB

Circular Permutations

Circular Permutations

Given N distinct items, determine the number of unique circular permutations. In a circular permutation, rotations are considered identical. Mathematically, for N > 1, the number of unique arrangements is given by the formula:

[ \text{Result} = (N - 1)! ]

For N = 0 or N = 1, there is exactly 1 unique arrangement. Your task is to read an integer N from standard input and output the number of unique circular permutations.

inputFormat

The input consists of a single integer N (0 ≤ N, typically N will be small enough such that (N-1)! fits within a 64-bit integer). The input is read from standard input.

outputFormat

Output the number of unique circular permutations computed as defined above, printed to standard output.## sample

1
1