Sum of Sequence

3.6

11 votes
Easy-Medium
Problem

This program is to take input (single positive integers say k and m ) and calculate and print the total sum as :-

K+KK+KKK+KKKK………… (The last number in the sequence should have m digits)

Input: 4 5

Output: 49380

Constraints: 0 <= k <= 9 and 0 <= m <= 25

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

The input contains 4 5 and the output calculates and print the total sum of - 4+44+444+4444+44444 and print 49380.

Editor Image

?