#ACSL1819I1. Digit Reassembly

Digit Reassembly

PROBLEM: Given a number less than 105010^{50} and length 𝑛, find the sum of all the 𝑛 -digit numbers (starting on the left) that are formed such that, after the first 𝑛 -digit number is formed all others are formed by deleting the leading digit and taking the next 𝑛 -digits.

For example, given 1325678905 2, the 2-digit numbers formed are 13, 32, 25, 56, 67, 78, 89, 90, and 05. The sum is 455.

INPUT: There will 5 lines of input. Each will contain a positive integer less than 1050 and a positive integer n.

OUTPUT: For each line of input, print the sum of the n-digit numbers formed.

SAMPLE INPUT

1325678905 2
54981230845791 5
4837261529387456 3
385018427388713440 4
623387770165388734652209 11

SAMPLE OUTPUT

455
489210
7668
75610
736111971668