Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.
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 .
Do not print any leading zeroes.
Input | Output |
---|---|
4 | 24 |
Input | Output |
---|---|
10 | 8800 |
85% Solution Ratio
ashik_jiddneyEarliest,
edge555Fastest, 0.0s
wasimur_01Lightest, 0 B
saitotaShortest, 36B
Login to submit