Олимпиадный тренинг

Задача 42968. Vasina arithmetic - 2


Задача

Темы: Цикл for
Vasya writes an integer n on the board. Next, with the number written on the board, he performs the following operation:
  • if the last digit of the number is not equal to zero, then Vasya erases the old number and writes on the board a new number equal to the minimum integer nbsp;nbsp;which is not less than the quotient of dividing the old number by the last digit of this number;< /li>
  • if the last digit of the number is zero, then it erases it.
What number will be written on the board after performing this operation k times?


Input
The first line of the input contains two integers n and k (2 <= n <= 109, 1 <= k <= 50) - the number that Vasya initially wrote on the board and the number of execution of the described operation.

Imprint
It is necessary to output one number - the answer to the problem.
 
 
Examples
# Input Output
1 512 4 3
2 10000 5  1