#include<stdio.h>
int main()
{
long long i,j,k[100],n,a[100],l;
scanf("%lld",&n);
for(i=0;i<n;i++)
{
scanf("%lld %lld",&k[i],&a[i]);
}
for(i=0;i<n;i++)
{
for(l=1;l<=a[i];l++)
{
if(k[i]%10!=0) k[i]--;
else k[i]/=10;
printf("%d\n",a[i]);
}
for(i=0;i<n;i++)
printf("%lld\n",k[i]);
}
return 0;
}
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/0742
75037636179.jpg "#left")