## DMOPC '16 Contest 2 P4 - Zeros

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem types

Recall that the factorial function is defined as follows: Given integers and , please find the number of natural numbers such that has a number of trailing zeros in the range of .

#### Constraints

##### Subtask 1 [20%] ##### Subtask 2 [30%] For the remaining 50% of the testcases, .

#### Input Specification

The first line of the input contains the two integers and .

#### Output Specification

The number of values of that satisfy the condition.

#### Sample Input

0 2

#### Sample Output

14

#### Explanation is the first element that satisfies the condition, and is the last element. Hence, there are a total of values of that satisfies the condition.

## Comments

• commented on Nov. 8, 2016, 5:47 p.m. edited

In the explanation you imply that natural numbers are 1,2,3, etc. but in the input specification you say a,b>=0

• commented on Nov. 9, 2016, 9:47 a.m. edited

Natural numbers of set N can be 0,1,2,3... or 1,2,3...

Wikipedia says there's no agreement on which one is "standard", whether 0 is included or not.

The set N* is used to specify positive numbers only, 1,2,3,4...

• commented on Nov. 9, 2016, 3:16 p.m.

Yes, but this problem's usage of natural numbers isn't consistent which led to confusion.