#P2044. ACSL 2018-2019 Senior Division Contest #1 Digit Reassembly
ACSL 2018-2019 Senior Division Contest #1 Digit Reassembly
Given a number less than and a length , starting on the left, form all non-overlapping -digit numbers. If there are digits remaining on the right, add trailing zeros to ensure that the last number is digits in length. Print the sum of all of the numbers formed.
For example, given , the -digit numbers formed from are and . The sum of all the numbers is .
INPUT FORMAT
There will lines of input. Each will contain a positive integer less than and a positive integer .
OUTPUT FORMAT
For each line of input, print the sum of all the -digit numbers formed.
SAMPLE
INPUT
13256709 3
3587612098 1
265472 5
3126854901231 4
25768437216701562 7
OUTPUT
789
49
46547
12798
15413544