#C12812. Factorial Calculation
Factorial Calculation
Factorial Calculation
Given an integer \(n\), calculate its factorial defined by the formula \(n! = n \times (n-1) \times \cdots \times 1\) for \(n \geq 1\) with the special cases \(0! = 1\) and for negative values output "Invalid input". This problem is designed for beginners and tests your understanding of recursion and basic arithmetic operations.
inputFormat
The input consists of a single integer \(n\) provided via standard input.
outputFormat
Output the factorial of \(n\) if \(n \geq 0\). If \(n\) is negative, output "Invalid input".
## sample5
120