Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Prepared by Ibrahim Mesecan.
The right-most non zero digit in N!
Question:
Write a program which shows the right-most non-zero
digit in N! where N is a positive integer less
than 32000. For example:
- 5!=120 ==> right-most non zero digit is 2
- 7!=5040 ==> right-most non zero digit is 4
- 10!=368800 ==> right-most non zero digit is 8
Input specification
You are given an integer (N) where is 1 ≤
N ≤ 32,000.
Output specification
Show right most non-zero digit in N!
Sample Input I |
Sample Input II |
345
|
1000
|
Sample Output I |
Sample Output II |
8
|
2
|
Для отправки решений необходимо выполнить вход.
|