#C14468. Memoized Factorial Computation

    ID: 44120 Type: Default 1000ms 256MiB

Memoized Factorial Computation

Memoized Factorial Computation

This problem requires you to compute the factorial of a given non-negative integer n using recursion combined with memoization. Recall that the factorial is defined as:

$$n! = \begin{cases}1 & n=0\\n\times (n-1)! & n\geq 1\end{cases}$$

Since factorials can be very large, you must output the result as a string. In addition, if the input is a negative integer, output the message "Input must be a non-negative integer".

Your solution should read from standard input and output the result to standard output.

inputFormat

The input consists of a single line containing one non-negative integer n.

outputFormat

Output the factorial of n as a string. If n is negative, output the error message exactly as "Input must be a non-negative integer".

## sample
0
1