#C14820. Factorial Calculation

    ID: 44512 Type: Default 1000ms 256MiB

Factorial Calculation

Factorial Calculation

Given a non-negative integer \(n\), compute its factorial using recursion.

The factorial is defined as follows:

\( n! = \begin{cases} 1 & \text{if } n = 0,\\ n \times (n-1)! & \text{if } n > 0 \end{cases} \)

For example, when \( n = 5 \), the factorial \( 5! = 120 \).

inputFormat

The input consists of a single non-negative integer \(n\) in one line. You can assume \(0 \leq n \leq 20\).

outputFormat

Output the factorial of \(n\) on a single line.

## sample
0
1