CCC '17 J2 - Shifty Sum

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

Suppose we have a number like 12. Let's define shifting a number to mean adding a zero at the end. For example, if we shift that number once, we get the number 120. If we shift the number again we get the number 1200. We can shift the number as many times as we want.

In this problem you will be calculating a shifty sum, which is the sum of a number and the numbers we get by shifting. Specifically, you will be given the starting number N and a non-negative integer k. You must add together N and all the numbers you get by shifting a total of k times.

For example, the shifty sum when N is 12 and k is 1 is: 12 + 120 = 132. As another example, the shifty sum when N is 12 and k is 3 is 12 + 120 + 1200 + 12000 = 13332.

Input Specification

The first line of input contains the number N (1 \leq N \leq 10\,000). The second line of input contains k, the number of times to shift N (0 \leq k \leq 5).

Output Specification

Output the integer which is the shifty sum of N by k.

Sample Input

12
3

Sample Output

13332

Comments


  • -1
    singbeilii  commented on Oct. 27, 2019, 1:50 p.m. edited

    1


  • -2
    singbeilii  commented on Oct. 27, 2019, 1:50 p.m. edited

    good!


  • -3
    singbeilii  commented on Oct. 27, 2019, 1:50 p.m. edited

    CCC good!


  • -29
    issamzar  commented on March 10, 2017, 3:32 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


    • -6
      ZippIE  commented on July 28, 2017, 10:13 a.m.

      This comment is hidden due to too much negative feedback. Click here to view it.


    • 32
      Xyene  commented on March 10, 2017, 3:59 p.m.

      Yes, because you submitted an editorial solution to a lot of problems without solving them yourself before. Each editorial is accompanied by a large warning that copy/pasting editorials can lead to bans on submitting a problem, so is it a surprise that you got banned doing so?

      I've unbanned you from this problem, but this isn't something that'll happen again.


      • -1
        RyanBadBoy  commented on Nov. 24, 2019, 8:05 p.m.

        Got him good.


  • -6
    TypicalToxic  commented on March 3, 2017, 8:10 p.m. edited

    This comment is hidden due to too much negative feedback. Click here to view it.