GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Friday 9 September 2022

[Solution] Yet Another Chef And Numbers CodeChef Solution



Problem

Chef is again playing with numbers.

He defines the rating of a number as the count of trailing zeros in the product of all the digits of the number.

Chef wants you to find the sum of ratings of all the numbers between the numbers A and B (excluding A). As the answer can be very large, print it modulo 10^9+7.

Note: If the product of the digits of a number is 0, the number's rating is defined to be 1.

Input Format

  • The first line contains 2 space-separated integers, A and B.

Output Format

Output a single integer, the sum of ratings of all the numbers between the numbers A and B (excluding A). As the answer can be very large, print it modulo 10^9+7.

Explanation:

10 will have rating 1 as its product of digits = 1 \cdot 0 = 0 has 1 trailing zero. All other numbers have a single digit and


Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇


 thus, no trailing zeroes.

Explanation:

Chef will rate 20,25, and 30 as 1 as the product of their digits have 1 trailing zeros. All other numbers have no trailing zeroes.

Explanation:

The product of digits of 455 is 4\cdot 5\cdot 5 = 100, which has 2 trailing zeroes. Thus, the rating is 2.

No comments:

Post a Comment