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

Задача 42967. Vasina arithmetic


Задача

Темы: Цикл 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 divides the number by this last digit and discards the fractional part (in this case, Vasya erases the old number from the board and writes a new one on the board);
  • 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 21
2 10000 5  1