~/algor $ cat problems/faktoriallar-yigindisi
Sum of factorials
Easy
1000 ms
64 MB
28%
A positive integer $N$ is given. Compute the sum of the factorials of the first $N$ positive integers:
$$S = 1! + 2! + 3! + \dots + N!, \qquad k! = 1 * 2 * \dots * k$$
Input
One positive integer $N$.
Output
One integer — $S$.
Note
$1 \le N \le 20$
Examples
Input #1
1
Output #1
1
Input #2
2
Output #2
3