The game LOL is an interesting game. Recently we are playing this game. Once I used a champion named Kog'Maw - The Mouth of the Abyss. For I have to support teammate, I only have a little time to do the last hit to kill the enemy's minions. There're N (2 <= N <= 10000) minions, each minion has a threat value TVi (1 <= TVi <= 9). And there's a formula to calculate the total threat value:
I only can kill K (1 <= K < N) minions. When I kill one minion, the minions after it will move to front for one step. It means when I kill Minion[5], then Minion[6] will be Minion[5] and Minion[7] will be Minion[6] and so on. How to kill the minions that I can leave the minimum total threat value?
输入
This problem contains several cases. Each case contains two numbers. The first number T is the total threat value at the very beginning (1 <= T < 10^10001). Then follows an integer K, means the number that minions I can kill.
输出
For each case, you should output the minimum total threat value after I kill K minions.