a plus aa plus aaa?


Submit solution

Points: 20 (partial)
Time limit: 5.0s
Memory limit: 256M

Authors:
Problem type

題目說明

輸入兩正整數(a與項次)

求s=a+aa+aaa+aaaa+aa…a的值。假設a=2,項次為3,則輸出結果的形式如:2+22+222=246;

輸入限制: 均>0

輸入

兩正整數

輸出

如上形式所示

sample input1

1 4

sample output1

1234

sample input2

3 2

sample output2

36

Comments

There are no comments at the moment.