#P2092. ACSL 2022-2023 Senior Division Contest #1 Next Base
ACSL 2022-2023 Senior Division Contest #1 Next Base
PROBLEM DESCRIPTION
Given positive integers, , , and , generate the next numbers in base starting with in the given base. We guarantee that the base will be between and inclusive. We guarantee that is a valid number in base . Find all of the digits in the numbers generated and print the number of times, in base , that the most frequently found digit occurs.
INPUT FORMAT
There will be three values representing how many numbers to generate, the base to be used between and inclusive, and the starting value in the base given that will be no more than digits long. We guarantee that is a valid number in base .
OUTPUT FORMAT
For each set of input values, find how many times each digit occurs in the sequence of numbers generated. Then output the number of times the digit that is found the most actually occurs.
SAMPLE
INPUT #1
15 8 2
OUTPUT #1
9
INPUT #2
25 2 1111011
OUTPUT #2
105
INPUT #3
20 12 9AB
OUTPUT #3
14
INPUT #4
10 16 ABCDEF
OUTPUT #4
10
INPUT #5
1000 2 1
OUTPUT #5
4938
EXPLANATION
Sample #1 Explanation
If , , and , the numbers generated are $2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20$. The digit that occurs most frequently is which occurs times so the output would be .