Given an integer N, print the trailing 4 digits of (N factorial).
Here are some examples of and their last 4 digits.
N | N Factorial () | Last 4 Digits |
---|---|---|
3 | 6 | 6 |
7 | 5040 | 5040 |
11 | 39916800 | 6800 |
15 | 1307674368000 | 8000 |
The input will contain an integer ().
Print the last 4 digits of . In case has less than 4 digits, do not print any leading zeros.
Input | Output |
---|---|
4 | 24 |
Input | Output |
---|---|
10 | 8800 |