Given a line of numbers, you need to calculate the sum of the numbers by n-gram of the line.
An example is demonstrated below.
Several lines of text
In the following example, there are four lines.
2
2
12345
1234
Note that there is no numerical text line start with the text digit "0."
The sums of all the n-grams of the given numerical text lines.
As the N for n-gram is 2 and the skip size is 2, the result of the above example is calculated by
12+34 = 46 (for the line of 12345, 23 and 45 are skipped)
12+34 = 46 (for the line of 1234, 23 is skipped)
Here is an illustration,

Taking another example, if the skip size is 1, the result of the above example is calculated by
12+23+34+45 = 114 (for the line of 12345)
12+23+34 = 69 (for the line of 1234)
Here is another illustration,
