Type: Default 1000ms 256MiB

末尾的0

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

Special for beginners, ^_^

Description

现有一数组 ff,且 fi = fi1+xf_i~=~f_{i-1}+x ,其中 f1 = 1f_1~=~1

给出1个 nn,求出 f1f_1fnf_n 中所有元素之积的末尾有几个连续0。

Format

Input

两个整数 xxnn

Output

f1f_1fnf_n 中所有元素之积的末尾有几个连续0。

Samples

3 34
9

Samples Explanation

数组 ff 为{1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100}。

各项之积为174548867015437739741494347897360069928419328000000000,末尾有连续的9个0。

Limitation

1x1041 \leq x \leq 10^4

1n31061 \leq n \leq 3 \cdot 10^6

信念

Not Attended
Status
Done
Rule
Ledo
Problem
6
Start at
2023-1-2 21:15
End at
2023-12-31 23:15
Duration
8714 hour(s)
Host
Partic.
14