#P2044. ACSL 2018-2019 Senior Division Contest #1 Digit Reassembly

ACSL 2018-2019 Senior Division Contest #1 Digit Reassembly

Given a number less than 105010^{50} and a length nn, starting on the left, form all non-overlapping nn-digit numbers. If there are digits remaining on the right, add trailing zeros to ensure that the last number is nn digits in length. Print the sum of all of the numbers formed.

For example, given 1325670913256709 33, the 33-digit numbers formed from are 132,567,132, 567, and 090090. The sum of all the numbers is 789789.

INPUT FORMAT

There will 55 lines of input. Each will contain a positive integer less than 105010^{50} and a positive integer nn.

OUTPUT FORMAT

For each line of input, print the sum of all the nn-digit numbers formed.

SAMPLE

INPUT

13256709 3
3587612098 1
265472 5
3126854901231 4
25768437216701562 7

OUTPUT

789
49
46547
12798
15413544