Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digits. Tanya subtracts one from a number by the following algorithm:  if the last digit of the number is non-zero, she decreases the number by one;  if the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit). You are given an integer number $$$n$$$. Tanya will subtract one from it $$$k$$$ times. Your task is to print the result after all $$$k$$$ subtractions.It is guaranteed that the result will be positive integer number.

The first line of the input contains two integer numbers $$$n$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le k \le 50$$$) — the number from which Tanya will subtract and the number of subtractions correspondingly.

Print one integer number — the result of the decreasing $$$n$$$ by one $$$k$$$ times. It is guaranteed that the result will be positive integer number.

NoteThe first example corresponds to the following sequence: $$$512 \rightarrow 511 \rightarrow 510 \rightarrow 51 \rightarrow 50$$$.

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main()
{int a,b;
scanf("%d%d",&a,&b);
while(b--)
{
    if(a%10!=0)
        a=a-1;
    else
        a=a/10;
}
printf("%d\n",a);
    return 0;
}

#include<stdio.h>

int main(){
    long n;
    int k;

    scanf("%ld%d", &n, &k);

    for(int i = 0; i < k; i++){
        if(n % 10 == 0)
            n /= 10;
        else
            n--;
    }
    printf("%ld", n);
}

#include <stdio.h>

int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    for(int i = 0;i < k;i++){
        if(n == 0){
            break;
        }
        if(n%10 == 0){
            n = n/10;
        }
        else{
            n--;
        }
    }
    printf("%d",n);
    return 0;
}

#include <stdio.h>
int main()
{
    int number,loop,k;
    scanf("%d %d",&number,&loop);
    for(k=1;k<=loop;k++)
    {
         if(number%10==0)
    {
        number=number/10;
    }
    else
    {
        number=number-1;
    }
    }
    printf("%d",number);
    return 0;
}

#include <stdio.h>

int main(int argc, char const *argv[])
{
    /* code */
    long int n, k;
    scanf("%ld %ld", &n, &k);

    for(int i = 0; i < k; i++){
        if(n % 10 == 0)
            n = n / 10;
        else
            n--;
    }
    printf("%ld\n", n);
    return 0;
}

#include<stdio.h>
int main(){
    int n,k,j ;
    scanf("%d %d",&n,&k);

    for(;k>0;){
          j=n%10;
          if(k>j){
              n/=10;
              k-=j;
              k-=1;  }
          else{n-=k;
               k=0;}
                }
           printf("%d",n);
           return 0;

}

#include<stdio.h>
int main()
{
  int a,b,n,i;
  scanf("%d %d",&a,&b);
   for(i=1;i<=b;i++)
   {
       if(a%10==0)
       {
           a=a/10;
       }
       else {a=a-1;}
   }
   printf("%d",a);
   return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d%d",&n,&k);
    for(i=1;i<=k;i++)
    {
        if(n%10==0)
     n=n/10;
     else
     n=n-1;
}
printf("%d",n);

}

#include<stdio.h>
int main()
{
	int n,k;
	scanf("%d %d",&n,&k);
	int i;
	for(i=0;i<k;i++)
	{
		if(n%10==0)
			n=n/10;
		else
			n=n-1;
	}
	printf("%d",n);
}

#include<stdio.h>
int main()
{
    int n,k,i,a;
    scanf("%d%d",&n,&k);
    for(i=0;i<k;i++)
    {
        a=n%10;
        if(a==0)
        {
            n=n/10;
        }
        else
        {
            n=n-1;
        }
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main(){long long n,k;
scanf("%I64d%I64d",&n,&k);
for(int i=0;i<k;i++){
    if(n%10==0)n/=10;else n--;
}
printf("%I64d",n);
    return 0;
}

#include<stdio.h>
int main()
{
long int n,k,i;
scanf("%ld%ld",&n,&k);

for(i=0;i<k;i++)
{
    if(n%10==0&&n!=0)
        n = n/10;

    else
        n--;
}
printf("%ld",n);

return 0;
}

#include<stdio.h>
int main()
{
    long long int i,a,k;
    scanf("%lld%lld",&a,&k);
    for(i=0;i<k;i++){
        if(a%10==0){
            a=a/10;
        }
        else{
            a=a-1;
        }
    }
    printf("%lld\n",a);
    return 0;
}

#include <stdio.h>
int main()
{
    long int n;
    int k;
    scanf("%ld %d",&n,&k);
    for(int i=1;i<=k;i++)
    {
	if(n%10==0)
	    n=n/10;
    	else
	    n=n-1;
    }
    printf("%ld \n",n);
    return 0;
}

#include<stdio.h>

int main()
{
    long int x;

    int y, i;

    scanf("%ld", &x);

    scanf("%d", &y);

    for(i=0; i<y; i++)
    {
        if(x%10 != 0)
        {
            x--;
        }
        else if(x%10 == 0)
        {
            x /= 10;
        }
    }

    printf("%d\n", x);

    return 0;
}

#include<stdio.h>
int main()
{
    long long int n,k,i,j,a,b;
    scanf("%lld %lld",&n,&k);
    for(i=1;i<=k;i++)
    {
        a=n%10;
        if(a==0)
        {
            b=n/10;
            n=b;
        }
        else if(a>0)
        {
            b=n-1;
            n=b;
        }
    }
    printf("%lld",n);
}

#include<stdio.h>
int main()
{
    int n,i,k;
    scanf("%d %d",&n,&k);
    for(i=1; i<=k; i++)
    {
        if(n%10==0)
        {
            n=n/10;
        }

        else
        {
            n=n-1;
        }

    }

    printf("%d\n",n);

    return 0;

}

#include <stdio.h>

int main()
{
    int n,k;
    scanf("%d %d",&n,&k);
    for(int i=1; i<=k; i++)
    {
        if(n%10==0)
            n=n/10;
        else if(n%10!=0)
            n=n-1;
        if(i==k)
        	printf("%d",n);
    }

}

#include<stdio.h>
int main()
{
    int n,k,i,last;
    scanf("%d %d",&n,&k);
    for(i=1;i<=k;i++)
    {
        last=n%10;

        if(last!=0)
        {
            n=n-1;
        }
        else
        {
            n=n/10;
        }
    }
    printf("%d\n",n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,count=0;
    scanf("%d%d",&n,&k);

    while(k--)
    {
        if(n%10!=0)
        {
        n--;
        }
        else
        {
            n/=10;
        }

}
    printf("%d",n);
}

#include<stdio.h>
int main(){
    int n,num;
    scanf("%d %d",&num,&n);
    for(int i=0;i<n;i++){
        if(num%10==0){
            num=(num/10);
        }else{
            num=num-1;
        }
    }
    printf("%d",num);
}

#include<stdio.h>
void main()
{
    int a;
    int b;
    scanf("%d %d", &a,&b);
    for(int i=0; i<b; i++)
        if(a%10==0)
            a/=10;
        else
            a--;
    printf("%d",a);
    exit(0);
}

#include<stdio.h>
int main()
{
    int n,i,last;
    long int k;
    scanf("%ld",&k);
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    last=k%10;
    if(last==0)
    k=k/10;
    else
    k=k-1;
    }
    printf("%ld",k);

}

#include<stdio.h>
int main(){
    int n,k,i=0;
    scanf("%d %d",&n,&k);
    while(i<k){
        if (n%10==0)
        {n=n/10;}
    else n-=1;
    i++;}
    printf( "%d ",n);

}

#include<stdio.h>
int main()
{
int n,k;
scanf("%d%d",&n,&k);
while(k)
{
if(n%10!=0)
n=n-1;
else
n=n/10;
k--;

}
printf("%d",n);
return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    long long int n;
    int k,i;
    scanf("%lld %d",&n, &k);
    for(i=1;i<=k;i++)
    {
        if(n%10!=0)
        n=n-1;
        else if(n%10==0)
        n=n/10;
    }
    printf("%lld",n);
    return 0;

}

#include<stdio.h>

int main()
{
    long long int a,k,n;
    scanf("%I64d %I64d",&a,&k);
    while(k--)
    {
        if(a%10==0)
        {
            n=a/10;
            a=n;
        }
        else if(a%10!=0)
        {
            n=a-1;
            a=n;
        }
    }
    printf("%I64d",n);
    return 0;
}

#include<stdio.h>
int main(){long long n,k;
scanf("%I64d%I64d",&n,&k);
for(int i=0;i<k;i++){
    if(n%10==0)n/=10;else n--;
}
printf("%I64d",n);
    return 0;
}

#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <malloc.h>
#include <memory.h>
#include <complex.h>
#include <errno.h>
int n,m;

int main()
{
	scanf("%d %d",&n,&m);
	while (m--)
	{
		if (n%10) n--;
		else n/=10;
	}
	printf("%d\n",n);
	return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d%d",&n,&k);
    for(i=1;i<=k;i++)
    {
        if(n%10==0)
            n=n/10;
        else
            n=n-1;
    }
    printf("%d",n);
}

#include<stdio.h>

int main()
{
    long int a ,b  ;
        scanf("%ld %ld",&a,&b);

    int last_digit =0;
   while(b != 0)
   {

       last_digit = a % 10;
       if(last_digit!=0)
       {

           a = a-1;
       }
       else
       {
           a = a/10;
       }

       b--;

   }

printf("%ld\n",a);

return 0;

}

#include <stdio.h>

int main()
{
    int i, n, k;

    scanf("%d%d", &n, &k);

    for(i = 1; i <= k; i++)
    {
        if(n%10 == 0)
            n = n / 10;
        else
            n = n - 1;
    }

    printf("%d\n", n);
    return 0;
}

#include<stdio.h>
int main()
{
	long long i,j,k,l,n,m;
	scanf("%lld%lld",&n,&k);
	for(i=1;i<=k;i++)
	{
		if(n%10!=0)
		{
			n=n-1;
		}
		else
		{
			n=n/10;
		}
	}
	printf("%lld",n);
	return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d",&n);
    scanf("%d",&k);
    for(i=1;i<=k;i++)
    {
        if(n%10!=0) n--;
        else n=n/10;
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main()
{
    long long int a,k,num,c;
    scanf("%I64d %I64d",&a,&k);
    while(k--){
    if(a%10==0){
        num=a/10;
        a=num;
    }
   else if(a%10!=0)
    {
        num=a-1;
        a=num;
    }
    }
    printf("%I64d",num);
    return 0;
}

#include<stdio.h>
int main()
{
    long long int i,a,k;
    scanf("%lld%lld",&a,&k);
    for(i=0;i<k;i++){
        if(a%10==0){
            a=a/10;
        }
        else{
            a=a-1;
        }
    }
    printf("%lld\n",a);
    return 0;
}

#include <stdio.h>

int main()
{
    long n;
    int k;

    scanf("%d%d", &n, &k);

    for(int i = 0; i < k; i++)
    {
        if(n%10 == 0)
        {
            n /= 10;
        }
        else
        {
            n -= 1;
        }
    }

    printf("%d", n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d %d",&n,&k);
    for(i=1;i<=k;i++)
    {
        if(n%10==0)
            n=n/10;
        else
            n--;
    }
    printf("%d\n",n);
    return 0;
}

#include<stdio.h>
int main()
{
  int a,b,n,i;
  scanf("%d %d",&a,&b);
   for(i=1;i<=b;i++)
   {
       if(a%10==0)
       {
           a=a/10;
       }
       else {a=a-1;}
   }
   printf("%d",a);
   return 0;
}

#include<stdio.h>

int main()
{
    int i,n,p;
    scanf("%d %d",&n,&p);
    for(i=0;i<p;i++)
    {
        if(n%10==0)
        {
            n = n/10;
        }
        else
        {
            n--;
        }
    }
    printf("%d",n);
    return 0;
}

#include <stdio.h>

int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    while(k--)
    {
        int rem=n%10;
        if(rem==0)
        n/=10;
        else
        n-=1;
    }
    printf("%d",n);
    return 0;
}

#include <stdio.h>
int main()
{
	int k,x,y,i;
	scanf("%d %d", &x,&k);
	for(i=0;i<k;++i)
	{
		y=x%10;
		if(y!=0)
		{
			--x;
		}
		else
		x/=10;
	}
	printf("%d",x);
}

#include<stdio.h>

int main()
{
          int n,k;
          scanf("%d%d",&n,&k);

          while(k!=0)
          {
               if(n%10!=0)
               n=n-1;

               else if(n%10==0)
               n=n/10;

               k--;
          }
          printf("%d",n);
}

#include<stdio.h>
int main()
{
    int num,k,i,count=0;
    scanf("%d%d",&num,&k);
    for(i=1;i<=k;i++)
    {
        if((num%10)==0)
        {
            num/=10;

        }
       else
        {
            num--;

        }
    }
    printf("%d\n",num);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d%d",&n,&k);
    for (i=1;i<=k;i++){
        if (n%10!=0){
            n--;

        }
        else n=n/10;
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
main(void)
{
    int n,k;
    scanf("%d %d",&n,&k);
    while(k--)
    {
        if(n%10==0)
            n/=10;
        else
            n-=1;
    }
    printf("%d",n);
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d %d", &n, &k);
    for (i=0;i<k;i++)
    {
        if (n%10==0)
            n=n/10;
        else n--;
    }
    printf("%d",n);
}

#include<stdio.h>

int main()
{
    int n,k;
    scanf("%d %d",&n,&k);

    int count=0;
    int temp=n;
    while(1) {
        if(temp%10==0) {
            temp=temp/10;
        }
        else {
            temp=temp-1;
        }
        count++;
        if(count==k) {
            break;
        }
    }
    printf("%d\n",temp);
    return 0;
}

#include<stdio.h>
int main()
{
    long long int number,i,n,z;
    scanf("%lld%lld",&number,&n);
    for(i=0;i<n;i++){
        z=number%10;
        if(z==0){
            number=number/10;
        }
        else{
            number-=1;
        }
    }
    printf("%d\n",number);
    return 0;
}

#include<stdio.h>
int main(){
    int i,m,a;
    scanf("%d %d",&m,&a);
    for(i=0;i<a;i++){
        if(m%10==0)m=m/10;
        else m=m-1;
    }
    printf("%d",m);
}

#include <stdio.h>
#include <math.h>

int main() {

	int n, k, t;

	scanf("%d %d", &n, &k);

	for (int i = 0; i < k; i++) {
		t = n % 10;

		if (t != 0) {
			n = n - 1;
		}
		else {
			n = n / 10;
		}
	}

	printf("%d", n);

	return 0;
}

#include<stdio.h>
int main(){
    int n,k,i=0;
    scanf("%d %d",&n,&k);
    while(i<k){
        if (n%10==0)
        {n=n/10;}
    else n-=1;
    i++;}
    printf( "%d ",n);

}

#include<stdio.h>
//#include<conio.h>
int main(){
int n,rem,k;//,c=0;
scanf("%d %d",&n,&k);
while(k--){
	rem=n%10;
	if(rem==0){
		n=n/10;
		}
	else{
		n=n-1;
	}
//k--;
	//c++;
	//if(c==k){
	//	break;
//}
}
printf("%d",n);
return 0;
}

#include <stdio.h>
int main()
{
int n , k ;
scanf("%d %d", &n ,&k);

for(int i=0 ; i<k ; i++){
   if(n%10==0){
        n=n/10;
    }
    else{
        n=n-1;
    }
}
printf("%d",n );
}

#include<stdio.h>
#include<math.h>
int main()
{
	int number,times;
	scanf("%d",&number);
	scanf("%d",&times);
	int k;
	int temp;
	int temp2;
	for(k=0;k<times;k++)
	{
		if(number>=0)
		{
			if(number%10==0)
			{
				number=number/10;
			}
			else
			{
				number=number-1;
			}
		}
		else
		{
			break;
		}
	}
	printf("%d",number);
}

#include<stdio.h>
int main()
{
 int n,i,k;
 scanf("%d%d",&n,&k);
 for(i=0;i<k;i++)
 {
     if(n%10==0)
     {
     n=n/10;
     }
 else n-=1;
}
printf("%d",n);
return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main(){
	int n,k;
	scanf("%d%d",&n,&k);

	while (k != 0){
		if (n % 10 == 0)
			n = n/10;
		else
			n=n-1;
		k-=1;
	}
	printf("%d",n);

}

#include<stdio.h>

int main()
{
    int i,n,p;
    scanf("%d %d",&n,&p);
    for(i=0;i<p;i++)
    {
        if(n%10==0)
        {
            n = n/10;
        }
        else
        {
            n--;
        }
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main(void)
{
    int n;
    int k;
    scanf("%d\t",&n);
    scanf("%d\n",&k);
    while((n>0)&&(k>=1))
    {
                      if(n%10==0){n=n/10;}
                      else{n=n-1;}
                      k--;
    }
    printf("%d",n);

}

#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <math.h>
int main()
{
	long long int n,k,mod,j=0,i;
	scanf("%lld%lld",&n,&k);
	for(i=1;i<=k;i++){
		mod=n%10;
		if(mod==0){
			n/=10;
		}
		else{
			n--;
		}
	}
	printf("%lld",n);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k;
    scanf("%d %d",&n,&k);
    while(k>0)
    {
        if(n%10>0)
        {
            n=n-1;
            k--;
            continue;
        }
        else
        {
            n=n/10;
            k--;
            continue;
        }
    }
    printf("%d",n);
    return 0;
}

#include <stdio.h>
int main ()
{
    long long int i,a,b;
    scanf("%lld %lld",&a,&b);
    for(i =0; i<b;i++){
        if((a % 10)!= 0){
            a = (a-1);
            continue;

        }
        if((a%10)==0){
            a = (a/10);
        }
    }

    printf("%lld",a);

    return 0;
}

#include <stdio.h>

int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    for(int i = 0;i < k;i++){
        if(n == 0){
            break;
        }
        if(n%10 == 0){
            n = n/10;
        }
        else{
            n--;
        }
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main()
{
	long long int n,k,i;
	scanf("%I64d%I64d",&n,&k);
	for(i=1;i<=k;i++){
		if(n%10==0) n=n/10;
		else n=n-1;
	}
	printf("%I64d\n",n);

	return 0;
}

 #include<stdio.h>
int main()
{
    int n;
    int k,i;
    scanf("%d%d",&n,&k);
    for(i=0;i<k;i++)
    {
        if(n%10==0)n/=10;
        else n-=1;
    }
    printf("%d",n);
}

#include<stdio.h>
int main()
{
int n,k;
scanf("%d%d",&n,&k);
while(k)
{
if(n%10!=0)
n=n-1;
else
n=n/10;
k--;

}
printf("%d",n);
return 0;
}

#include <stdio.h>

int main()
{
    int n,c,i;
    scanf("%d %d", &n, &c);
    for (i=1; i<=c; i++)
    {
        if((n%10)!=0)
        {
             n--;

        }
        else
        {
            n/=10;

        }
    }

    printf("%d\n",n);

    return 0;
}

#include<stdio.h>
int main(void)
{
    long long unsigned int n;
    int k;
    scanf("%I64d\t",&n);
    scanf("%d\n",&k);
    while((n>0)&&(k>=1))
    {
                      if(n%10==0){n=n/10;}
                      else{n=n-1;}
                      k--;
    }
    printf("%I64d",n);

}

#include<stdio.h>
int main()
{
  int a,b,n,i;
  scanf("%d %d",&a,&b);
   for(i=1;i<=b;i++)
   {
       if(a%10==0)
       {
           a=a/10;
       }
       else {a=a-1;}
   }
   printf("%d",a);
   return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i=0,p;
    scanf("%d %d",&n,&k);
    for(i=0;i<k;i++)
    {
        if(n%10!=0)
        {
            n=n-1;
        }
        else
        {
        n=n/10;
        }
    }
    printf("%d",n);
    return 0;
}

#include <stdio.h>

int main() {
   int n,k,i;
   scanf("%d %d",&n,&k);
   i=k;
   while(i>0) {
       if (n%10 == 0) {
           n = n/10;
           i--;
       }
       else {
           int t = n%10;
           if (t<=i) {
               n = n - t;
               i = i-t;
            }
           else {
               n = n-i;
               i = 0;
           }
       }
   }
   printf("%d",n);
   return 0;
}

#include<stdio.h>

int main()
{
    long long int k,i,n,r;
    scanf("%lld %lld",&n,&k);
    for(i=1;i<=k;i++)
    {
        r=n%10;
        if(r==0)
        {
            n/=10;
        }
        else
            n--;
    }
     printf("%lld\n",n);
    return 0;
}

#include<stdio.h>
int main()
{
    int i=0,n,k;
    scanf("%d",&n);
    scanf("%d",&k);
    while(k>0)
    {
        if(n%10 == 0)
        {
            n= n/10;
        }
        else
        {
            n=n-1;
        }
        k--;
    }
    printf("%d",n);

}

#include <stdio.h>
#include <stdlib.h>

int main()
{   int n,k,x=0;
    scanf("%d %d",&n,&k);
    while(n>0&&x<k){
    if (n%10==0) n=n/10;
    else n--;
    x++;}
    printf("%d",n);
    return 0;
}

#include <stdio.h>

int main(void) {
    int k,n;
        scanf("%d",&n);
        scanf("%d",&k);

        while(k--){
            if(n%10 == 0){
                n= n / 10;
            }
            else{
                n = n - 1;
            }
        }
            printf("%d",n);

	// your code goes here
	return 0;
}

#include<stdio.h>
int main()
{
    long long int n;
    int k,i;
    scanf("%I64d%d",&n,&k);
    for(i=1;i<=k;i++)
    {
        if(n%10==0) n=n/10;
        else n=n-1;

    }
    printf("%I64d\n",n);
    return 0;
}

#include<stdio.h>
int main()
{
	long long i,j,k,l,n,m;
	scanf("%lld%lld",&n,&k);
	for(i=1;i<=k;i++)
	{
		if(n%10!=0)
		{
			n=n-1;
		}
		else
		{
			n=n/10;
		}
	}
	printf("%lld",n);
	return 0;
}

#include<stdio.h>
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    while(k--){
        if(n %10 == 0)
        n/=10;
        else
        n--;
    }
    printf("%d",n);
    return 0;

}

#include <stdio.h>

int main()
{
    int n, k;
    scanf("%d %d", &n, &k);
    while(k--) {
        if(n % 10 == 0) {
            n /= 10;
        } else {
            --n;
        }
    }
    printf("%d\n", n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,count=0;
    scanf("%d%d",&n,&k);

    while(k--)
    {
        if(n%10!=0)
        {
        n--;
        }
        else
        {
            n/=10;
        }

}
    printf("%d",n);
}

#include <stdio.h>

int subtraction(int n, int k){
	while(k){
		if (n % 10 != 0)
			n--;
		else
			n /= 10;
        k--;
	}
	return n;
}

int main() {

	int n, k;
	scanf("%d %d", &n, &k);
	printf("%d", subtraction(n,k));
	return 0;
}

#include<stdio.h>

int main()
{
  long int n;
  int k;
  scanf("%li",&n);
  scanf("%d",&k);
  while((k>0)&&(n>=0))
  {
    if(n%10==0)
    {
      n=n/10;
      k--;
    }
    else
    {
      n--;
      k--;
    }
  }
  printf("%li",n);
  return 0;
}

#include<stdio.h>
int main()
{
        int s,i,n;
        scanf("%d %d",&s,&n);
        for(i=0;i<n;i++)
        {
                if(s%10==0)
                s=s/10;
                else
                s=s-1;
        }
printf("%d",s);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,i;
    printf("enter the number you want to be subtracted");
    scanf("%d",&n);
    printf("how many times do you want to be subtracted tanya ");
    scanf("%d",&k);
    for(k;k!=0;k--)
    {
        if (n%10==0)
        {
            n=n/10;
        }
        else
        {
            n--;
        }

        printf("%d \n",n);
    }
    return 0;
}

int main()
{
    long n;
    int k;

    scanf("%l%d", n, k);

    for(int i = 0; i < k; i++)
    {
        if(n%10 == 0)
        {
            n /= 10;
        }
        else
        {
            n -= 1;
        }
    }
    return n;
}

#include <stdio.h>
int main(void)
{
    int n,k,i;
    printf("imput n k:");
    scanf("%d %d",&n,&k);
    for (size_t i= 1; i < k+1; i++)
    {
        if ((n%10==0))
        {
            n=n/10;
        }
        else
        {
            n=n-1;
        }

    }
    printf("%d",n);
    getchar();
    getchar();
    return 0;
}

#include <stdio.h>
int main()
{
    int n = 0, k = 0, i;

    for(int i = 0; i < k; i++){
        if(n % 10 == 0){
            n = n/10;
        }
        else{
            n = n - 1;
        }
    }

    printf("%d", n);
}

#include<stdio.h>

int main()
{

 int n,k,i;

 scanf("%d %d",&n,&k);

    for(i=0;i<k;i++)
    {

        if(n%10==0)
        {
            n=n/10;

        }

        else
        {

            n--;

        }

    }

    return 0;
}

#include<stdio.h>

int main()
{

 int n,k,i;

 scanf("%d %d",&n,&k);

    for(i=0;i<k;i++)
    {

        if(n%2==0)
        {
            n=n/10;

        }

        else
        {

            n--;

        }

    }

    printf("%d",n);

    return 0;
}

#include<stdio.h>
int main(void)
{
	long long int N;
	int k;
	scanf("%d %d",&N,&k);
	while(k--)
	{
		if(N%10==0)
		N/=10;
		else
		N--;
	}
	printf("%d",N);
}

/*Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digits. Tanya subtracts one from a number by the following algorithm:

if the last digit of the number is non-zero, she decreases the number by one;
if the last digit of the number is zero, she divides the number by 10 (i.e. removes the last digit).
You are given an integer number n. Tanya will subtract one from it k times. Your task is to print the result after all k subtractions.

It is guaranteed that the result will be positive integer number.

Input
The first line of the input contains two integer numbers n and k (2≤n≤10E9, 1≤k≤50) — the number from which Tanya will subtract and the number of subtractions correspondingly.

Output
Print one integer number — the result of the decreasing n by one k times.

It is guaranteed that the result will be positive integer number.
*/

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k;
    scanf("%d %d",&n,&k);

    while (k!=0)
    {
        if ( n%10 != 0)
        {
        n=n-1;
        }
        else
            {
                n=n/10;
            }
    k--;

    }
    printf("Result = %d",n);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main ()
{
    int x;
		int count=0;
		printf("Please Enter Number");
		scanf("%d",&x);
		while	(x>1)
		{		if	(x%10==0)
					{	x=x/10;;
					}
				else
					{x--;
					}
					count++;
		}
		printf("Count=%d",count);
    return 0;
}

#include <stdio.h>

int main(int argc, char const *argv[])
{
    /* code */
    long long n, k;
    scanf("%ld %ld", &n, &k);

    for(int i = 0; i < k; i++){
        if(!n % 10)
            n = n / 10;
        else
            n--;
    }
    printf("%d\n", n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,i,last;
    long int k;
    scanf("%ld d",&k,&n);
    printf("%d",n);
    for(i=0;i<n;i++)
    {
    last=k%10;
    if(last==0)
    k=k/10;
    else
    k=k-1;
    }
    printf("%ld",k);

}

#include <stdio.h>
#include <stdlib.h>

int main()
{   int x;
    int count =0;
    x=512;

    while (x>0)
    {
        if (x%10 == 0)
        {
            x=x/10;
        }
        else
        {
            x--;
            count++;
        }
    }

    printf("The counter = %d",count);

    return 0;
}

#include<stdio.h>
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    for(k=0;k<k;k++)
    {
        if(n%10!=0)
        {
            n--;
        }
        else
        {
            n=n/10;
        }
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    for(i=0;i<k;i++)
    {
        if(n%10==0)
        n=n/10;
        else
        n=n-1;
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>

int main()
{
    int n,k,i;
scanf("%d %d",&n,&k);
  for(i=1;i<=k;i++)
  {
  if(n%10==0)
  n=n/10;
  else if(n%10!=0)
  n--;
  }
  printf("the last value is %d",n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,r,i;
    for(i=0;i<=k;i++)
    {
        r=n%10;
        if(r==0)
        n=n/10;
        else
        n=n-1;
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    int i;
    for(i=1;i<=k;i++){
        if(n%10!=0){
            n=n-1;
            break;
        }
        if(n%10==0){
            n=n/10;
        }
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    long long int n;
    int k,i;
    scanf("%lld %d",&n, &k);
    for(i=1;i<k;i++)
    {
        if(n%10!=0)
        n=n-1;
        else if(n%10==0)
        n=n/10;
    }
    printf("%lld",n);
    return 0;

}

#include<stdio.h>
int main () {
    int num,k,m;
    scanf("%d %d",&num,&k);
    m=num % 10;
    while (k--) {
     if (m == 0 ) {
        num=num / 10;
     }
     else{
         num--;
     }
    }
    printf("%d\n",num);
}

#include <stdio.h>
int main()
{
    int n = 0, k = 0, i;

    for(i = 0; i<k; i++){
        if(n%10 == 0){
            n /= 10;
        }
        else{
            n -= 1;
        }
    }
    printf("%d", n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i=0;
    printf("n&f");
    scanf("%d%d",&n,&k);
    while(i<k)
    { if (n%10!=0){n=n-1;}
    else if (n%10==0){n=n/10;}
    printf("the no is %d ",n);
        i++;
    }
}

#include<stdio.h>
#include<conio.h>
int main(){
int n,rem,k;//,c=0;
scanf("%d",&n,&k);
while(n && k--){
	rem=n%10;
	if(rem==0){
		n=n/10;
		}
	else{
		n=n-1;
	}
//k--;
	//c++;
	//if(c==k){
	//	break;
//}
}
printf("%d",n);
return 0;
}

#include<stdio.h>
int main(){
    int n,k,j ;
    scanf("%d %d",&n,&k);

    if(k>0){
          j=n%10;
          if(k>j){
              n/=10;
              k-=j;
              k-=1;
                  }
          else{n-=k;
               k=0;}
                }
           printf("%d",n);
           return 0;

}

#include<stdio.h>

int wrongSubstraction ( int x, int z );

int main() {
    // wrongSubstraction(512, 4);
    // wrongSubstraction(1000000000, 9);
}

int wrongSubstraction(int n, int k) {

    while(k>0) {
        if(n%10!=0)
            n-=1;
        else
            n/=10;
        k--;
    }

    return n;
}

#include<stdio.h>
int main()
{
    int a,k;
    int temp;
    scanf("%d %d",&a,&k);
    while(k!=0)
    {
        temp=a%10;
        if(temp>=1)
        {
            temp-=1;
            a=a/10+temp;
        }
        else
        {
            a=a/10;
        }
        k--;
    }
    return 0;
}

#include <stdio.h>

int main(void) {
    int k,n;
        scanf("%d",&k);
        scanf("%d",&n);

        while(k--){
            if(n%10 == 0){
                n= n / 10;
            }
            else{
                n = n - 1;
            }

        }
                            printf("%d",n);

	// your code goes here
	return 0;
}

#include<stdio.h>
int main()
{
    int n,temp,x,i,X,rem,count=0,p;
    scanf("%d %d",&x,&n);
    temp=x;
    for(i=1;i<=n;i++)
    {
        if(temp%10==0)
            break;
        if(temp%10!=0)
        {
            temp--;
            count++;
        }
    }
    printf("%d\n%d\n",temp,count);
    for(i=1;i<=n-count;i++)
    {
        if(temp%10!=0)
        {
            temp--;
        }
        if(i==n-count)
            break;
        if(temp%10==0)
        {
        rem=temp/10;
        temp=rem;
        }
    }
    printf("%d",temp);

    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i;
    scanf("%d %d", &n, &k);
    for(i = 1 ; i <=k ; i++)
    {
        if(n%10 == 0)
            n=n%10;
        else
            n = n--;
    }
    printf("%d\n", n);
    return 0;
}

#include<stdio.h>
int main()
{
    int i,x,n,last;
    scanf("%d%d",&n,&x);
    for(i=1;i<=x;i++)
    {
        last=n%10;
        if(last!=10)
        {
            n=n-1;
        }
        else
        {
            n=n/10;
        }
    }
    printf("%d\n",n);
    return 0;
}

#include <stdio.h>

int main(){
    long n,k;
    scanf("%l %l",&n,&k);
    while(k--){
        if(n%10==0)
        n = (n/10)-1;
        else
        n = n-1;
    }
    printf("%l",n);
    return 0;
}

#include <stdio.h>

int main (void){
    int k, n;

    scanf ("%d %d", &n , &k);

    while ( (n/10) != 0)
    if  (n % 10 == 0) {
        n /= 10;
    }
    else if( n % 10 != 0)
    {
        n--;
    }

    printf("%d", n);
    return 0;
}

#include<stdio.h>
int main(){

    int n,k;
    int i;
    printf("input the positive integer number:");
    scanf("%d",&n);

    printf("input the number of substractions:");
    scanf("%d",&k);

    for(i=1;i<=k;i++){
       if(n>9) {
        if(n%10==0)
        n=n/10;
        else
        n=n-1;
    }}
    printf("%d",n);
}

#include<stdio.h>

int main()
{

 int n,k,i;

 scanf("%d %d",&n,&k);

    for(i=0;i<k;i++)
    {

        if(n%10==0)
        {
            n=n/10;

        }

        else
        {

            n--;

        }

    }

    return 0;
}

#include <stdio.h>
int main()
{
    int n = 0, k = 0, i;

    for(int i = 0; i < k; i++){
        if(n % 10 == 0){
            n = n/10;
        }
        else{
            n = n - 1;
        }
    }

    printf("%d", n);
}

#include <stdio.h>
int main(){
    int n, k, i;

    printf("enter n and k : ");
    scanf("%d %d", &n);

    for(i = 0; i < k; i++){
        if(n % 10 == 0){
            n = n/10;
        }
        else{
            n = n - 1;
        }
    }
    printf("%d", n);

}

#include <stdio.h>

int main()
{
    long n;
    int k;

    scanf("%l%d", &n, &k);

    for(int i = 0; i < k; i++)
    {
        if(n%10 == 0)
        {
            n /= 10;
        }
        else
        {
            n -= 1;
        }
    }

    printf("%d", n);
    return 0;
}

#include<stdio.h>
int main()
{
	int b;
	int i;
	long long int a;
	scanf ("%l64d %d", &a, &b);
	for (i=0; i<b&&a>=10; i++)
	{
		if (a%10==0)
		{
			a=a/10;
		}
		else if(a%10!=0)
		{
			a=a-1;
		}
	}
	printf ("%l64d", a);
	return 0;
}

#include<stdio.h>
int main()
{
    int a,k;
    scanf("%d %d",&a,&k);
    while(k!=0)
    {
        if(a%10==0)
        {
            a/=10;
        }
        else
        {
            a--;
        }
        k--;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n,temp,x,i,X,rem,count=0,a,count1=0;
    scanf("%d %d",&x,&n);
    temp=x;
    for(i=1;i<=n;i++)
    {
        if(temp%10==0)
            break;
        if(temp%10!=0)
        {
            temp--;
            count++;
        }
    }
    a=n-count;
   // printf("%d\n",a);
    for(i=1;i<=a-1;i++)
    {
        if(temp%10!=0)
        {
            temp--;
            continue;
        }
        if(temp%10==0)
        {
        rem=temp/10;
        temp=rem;
        }
    }
    //printf("%d\n%d\n",temp,count);
    for(i=a;i<=a;i++)
    {
       if(temp%10!=0)
        {
            temp--;
            count1++;
        }
        if(count1==1)
            break;
        if(temp%10==0)
        {
        rem=temp/10;
        temp=rem;
        }
    }
    printf("%d",temp);

    return 0;
}

#include<stdio.h>
int main(){
    int n,k;
    scanf("%d%d",&n,&k);
    int rem;
    for(int i=1;i<=k;i++){
          rem=n/10;
    if(rem!=0){
        n=n-1;
    }
    else if(rem==0){
        n=n/10;
    }
    printf("%d",n);
   }
}

#include <stdio.h>
#include <math.h>

int main() {

	int n, k, t;

	printf("n k = ");
	scanf("%d %d", &n, &k);

	for (int i = 0; i < k; i++) {
		t = n % 10;

		if (t != 0) {
			n = n - 1;
		}
		else {
			n = n / 10;
		}
	}

	printf("%d", n);

	return 0;
}

#include <stdio.h>

int main (void){
    int k, n;

    scanf ("%d %d", &n , &k);

    if (n % 10 != 0) {
        n /= 10;
    }
    else
    {
        n--;
    }

    printf("%d", n);
    return 0;
}

#include<stdio.h>
#include<math.h>
int main(){
    int n,k,i;
    printf("n=");
    scanf("%d",&n);
    printf("k=");
    scanf("%d",&k);
    while(k!=0){
        if(n%10!=0)
           n=n-1;
     else
        n=n/10;
     --k;
    }
    printf("%d",n);

}

#include<stdio.h>
int main()
{
    int a,b,i,x;
    scanf("%d %d",&a,&b);
    for(i=0;i<b;i++)
    {
        x=a%10;
        if(x==0)
        {
            a=a-1;
        }
        else
        {
            a=a/10;
        }
    }
    printf("%d\n",a);
    return 0;
}

#include<stdio.h>
int main()
{int n,k,i;
i=0;
scanf("%d%d",&n,&k);
while(i<=k)
{

if(n%10==0)

  n=n/10,i++;

else

  n=n-1,i++;

}
printf("%d",&n);
}

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int n, k;
	printf("The number from which Tanya will substract is:");
	scanf("%d", &n);
	printf("The number of substractions is:");
	scanf("%d", &k);
	while (k != 0)
	{
		if (n % 10 != 0)
		{
			n -= 1;
		}
		else
		{
			n /= 10;
		}
		k--;
	}
	printf("%d", n);
	return 0;
}

#include<stdio.h>
int main(){
    int n,k;
    scanf("%lldd %lld",&n,&k);
    while(k--){
        if(n %10 == 0)
        n/=10;
        else
        n--;
    }
    printf("%lld",n);
    return 0;

}

#include <stdio.h>

int main(void) {
	// your code goes here

    int n,k;
    n<=(10^9)&&n>=2;
    k<=50&&k>=1;
    printf("Enter 2 numbers");
    scanf("%d%d",&n,&k);

    for(int i=0; i<n; i++)
     {
         if(n%10 !=0)
          {
              n=n-1;
          }
         else

           n=n/10;

      }

      printf("%d",n);
	return 0;
}

#include <stdio.h>
int main(void)
{
    int n,k,i;
    n=512;
    k=4;
    for (size_t i= 1; i < k+1; )
    {
        if ((n%10==9))
        {
            i=i-1;
            n=n/10;
            n=n+2;
        }
        else
        {
            i=i+1;
            n=n-1;
        }

    }
    printf("your finnal number n=%d",n);
    getchar();
    getchar();
    return 0;
}

#include<stdio.h>

int wrongSubstraction ( int x, int z );

int main() {
    wrongSubstraction(512, 4);
    wrongSubstraction(1000000000, 9);
    return 0;
}

int wrongSubstraction(int n, int k) {

    while(k>0) {
        if(n%10!=0)
            n-=1;
        else
            n/=10;
        k--;
    }

    return n;
}

#include<stdio.h>
int main()
{
  int a,b,n,i;
  scanf("%d %d",&a,&b);
   for(i=1;i<=b;i++)
   {
       if(a%10==0)
       {
           a=a/10;
       }
       //else {a=a-1;}
   }
   printf("%d",a);
   return 0;
}

#include<stdio.h>
int main()
{
    long long int x,p,q;
    scanf("%lld %lld",&x,&p);
    while(p>0){
    {
        if(x%10==0)
            q=x/10;
        else
            q=x-1;
    }
    printf("%lld\n",q);
    p--;
    }
   return 0;
   }

#include <stdio.h>

int main(int argc, char const *argv[])
{
    /* code */
    long long n, k;
    scanf("%ld %ld", &n, &k);

    for(int i = 0; i < k; i++){
        if(!(n % 10))
            n /= 10;
        else
            n--;
    }
    printf("%d\n", n);
    return 0;
}

#include<stdio.h>
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    while(k--){
        if (n%10==0)
        {n=n/10;}
    else(n-=1);
    printf( "%d ",n);
    }
}

#include<stdio.h>

int main()
{
  long long n;
  int k;
  scanf("%ll",&n);
  scanf("%d",&k);
  while((k>0)&&(n>=0))
  {
    if(n%10==0)
    {
      n=n/10;
      k--;
    }
    else
    {
      n--;
      k--;
    }
  }
  printf("%ll",n);
  return 0;
}

#include<stdio.h>
int main(void)
{
	long long int N;
	int k;
	scanf("%d %d",&N,&k);
	while(k--)
	{
		if(N%10==0)
		N/=10;
		else
		N--;
	}
	printf("%d",N);
}

#include <stdio.h>

int main(){
    long n;int k;
    scanf("%l %d",&n,&k);
    while(k--){
        if(n%10==0)
        n = (n/10)-1;
        else
        n = n-1;
    }
    printf("%l",n);
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main()
{int a,b;
scanf("%d%d",&a,&b);
while(b--)
{
    if(a%10==0)
        a=a-1;
    else
        a=(a/10)*10;
}
printf("%d\n",a);
    return 0;
}

#include<stdio.h>
int main()
{
 int n,i,k;
 scanf("%d%d",&n,&k);
 for(i=0;i<k;i++)
 {
     if(n%10==0)
     {
     n=n/10;
     }
 else n=-1;
}
printf("%d",n);
return 0;
}

#include<stdio.h>
int main(void)
{
    long long unsigned int n;
    int k;
    scanf("%I64d\t",&n);
    scanf("%d\n",&k);
    while((n>0)&&(k>=1))
    {
                      if(n%10==0){n=n/10;}
                      else{n=n-1;}
    }
    printf("%I64d",n);

}

#include<stdio.h>
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    int i=n;
    while(k--){
        if(n%10!=0){
            n=n-1;
        }
        if(n%10==0){
            n=n/10;
        }
    }
    printf("%d",n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k;
    printf("n&f");
    scanf("%d%d",&n,&k);
    while(k--)
    { if (n%10!=0){n=n-1;}
    else if (n%10==0){n=n/10;}
    printf("the no is %d ",n);}
}

#include<stdio.h>
int main()
{
    long long int x,p;
    scanf("%lld %lld",&x,&p);
    while(p!=0){
    {
        if(x%10==0)
            x=x/10;
        else
            x=x-1;
    }
    printf("%lld\n",x);
    p--;
    }
   return 0;
   }

#include<stdio.h>

int wrongSubstraction ( int x, int z );

int main() {
    int a, b;
    scanf("%d, %d", &a, &b);
    printf("%d", wrongSubstraction(a, b));
    return 0;
}

int wrongSubstraction(int n, int k) {

    while(k>0) {
        if(n%10!=0)
            n-=1;
        else
            n/=10;
        k--;
    }

    return n;
}

#include<stdio.h>

int main()
{

 int n,k,i;

 scanf("%d %d",&n,&k);

    for(i=0;i<k;i++)
    {

        if(n%2==0)
        {
            n=n/10;

        }

        else
        {

            n--;

        }

    }

    return 0;
}

#include<stdio.h>
int main(){long long n,k;
scanf("%I64d%I64d",&n,&k);
for(int i=0;i<k;i++){
    if(n%10==0)n/10;else n--;
}
printf("%I64d",n);
    return 0;
}

#include<stdio.h>
int main()
{
    int n,i,last;
    long int k;
    scanf("%ld d",&k,&n);
    for(i=0;i<n;i++)
    {
    last=k%10;
    if(last==0)
    k=k/10;
    else
    k=k-1;
    printf("%ld\n",k);
    }
    printf("%ld",k);

}

#include<stdio.h>
int main () {
    int num,k,m;
    scanf("%d %d",&num,&k);
    m=(num % 10);
    while (k--) {
     if (m == 0 ) {
        num=num / 10;
     }
     else{
         num--;
     }
    }
    printf("%d",num);
}

#include <stdio.h>

int main() {
	// your code goes here

    int n,k,t;
    n<=(10^9)&&n>=2;
    k<=50&&k>=1;
    printf("Enter 2 numbers");
    scanf("%d%d",&n,&k);

    for(int i=0; i<k; i++)
     {
         t=n%10;
         if(t==0)
          {
              n=n/10;
          }
         else

           n=n-1;

      }

      printf("\n%d",n);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,r;
    scanf("%d %d",&n,&k);

   r=re(n,k);
    printf("%d",r);

}
int re(int n,int k)
{

    while(k>0&&n>1)
    {
    if((n%10)==0)
     return(re(n/10,k-1));
    else
    return(re(n-1,k-1));
    }
}

#include<stdio.h>
int main()
{
	long long n;
	int k,i;
	scanf("%d%d",&n,&k);
	for(i=1;i<=k;i++)
	{
		if(n%10==0)
		{
			n=n/10;
		}
		else
		{
			n=n-1;
		}
	}
	printf("\n");
	printf("%lld",n);
	return 0;
}

#include<stdio.h>
int main(){
    int n,k,count=0;
    scanf("%d%d",&n,&k);
    while(k--){
        if(n%10==0)
        printf("%d",n/10);
        else
        n--;
    }
    printf("%d",n);
}

#include<stdio.h>
int main()
{
long int n,k,i;
scanf("%lli%lli",&n,&k);

for(i=0;i<k;i++)
{
    if(n%10==0&&n!=0)
        n = n/10;

    else
        n--;
}
printf("%lli",n);

return 0;
}

#include <stdio.h>

int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    while(k--){
        if(n%10==0)
        n = (n/10)-1;
        else
        n = n-1;
    }
    printf("%d\n",n);
    return 0;
}

#include <stdio.h>

int main (void){
    int k, n;

    scanf ("%d %d", &n , &k);

    if (n % 10 != 0) {
        n /= 10;
    }
    else if( n % 10 == 0)
    {
        n--;
    }

    printf("%d", n);
    return 0;
}

#include<stdio.h>
#include<math.h>
int main(){
    int n,k,i;
    printf("n=");
    scanf("%d",&n);
    printf("k=");
    scanf("%d",&k);
    while(k>=n){
        scanf("%d",&k);
    }
    while(k!=0){
       if(n%10!=0)
           n=n-1;
       else
        n=n/10;
     --k;
    }
     printf("%d",n);

}

#include<stdio.h>
int main()
{
    int n,i,last;
    long int k;
    scanf("%ld d",&k,&n);
    for(i=0;i<n;i++)
    {
    last=k%10;
    if(last==0)
    k=k/10;
    else
    k=k-1;
    }
    printf("%ld",k);

}

#include <stdio.h>

int main() {
   int n,k,i;
   scanf("%d %d",&n,&k);
   i=k;
   while(i>0) {
       if (n%10 == 0) {
           n = n/10;
       }
       else {
           int t = n%10;
           if (t<=i) {
               n = n - t;
               i = i-t;
            }
           else {
               n = n-i;
               i = 0;
           }
       }
   }
}

#include<stdio.h>
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    for(k=0;k<k;k++)
    {
        if(n%10!=0)
        {
            n--;
        }
        else
        {
            n=n/10;
        }
    }
    printf("%d",n);
    return 0;
}


Bob is about to take a hot bath. There are two taps to fill the bath: a hot water tap and a cold water tap. The cold water's temperature is t1, and the hot water's temperature is t2. The cold water tap can transmit any integer number of water units per second from 0 to x1, inclusive. Similarly, the hot water tap can transmit from 0 to x2 water units per second.If y1 water units per second flow through the first tap and y2 water units per second flow through the second tap, then the resulting bath water temperature will be:Bob wants to open both taps so that the bath water temperature was not less than t0. However, the temperature should be as close as possible to this value. If there are several optimal variants, Bob chooses the one that lets fill the bath in the quickest way possible.Determine how much each tap should be opened so that Bob was pleased with the result in the end.

You are given five integers t1, t2, x1, x2 and t0 (1 ≤ t1 ≤ t0 ≤ t2 ≤ 106, 1 ≤ x1, x2 ≤ 106).

Print two space-separated integers y1 and y2 (0 ≤ y1 ≤ x1, 0 ≤ y2 ≤ x2).

NoteIn the second sample the hot water tap shouldn't be opened, but the cold water tap should be opened at full capacity in order to fill the bath in the quickest way possible.

#include <stdio.h>
int main()
{
    long long t1,t2,x1,x2,t0,x,y;
    double t,tt=0x3f3f3f3f;
    scanf("%lld %lld %lld %lld %lld",&t1,&t2,&x1,&x2,&t0);
    while(x1>=0&&x2>=0)
    {
        t=(t1*x1+t2*x2)*1.0/(x1+x2);
        if(t<t0)
        {
            x1--;
        }
        else
        {
            if(t<tt)
            {
                tt=t;
                x=x1;
                y=x2;
            }
            x2--;
        }
    }
    printf("%lld %lld\n",x,y);
    return 0;
}

#include <stdio.h>

int r() { int x; scanf("%d",&x); return x; }

int main()
{
    int y,z; long long u=r(),v=r(),w=r(),x=r(),t=r(),a=t-u,b=v-t,p=1,q=0,g=w+x,f=u*w+v*x-t*g;

    for(;w>=0;--w,--g,f+=a)
        for (;x>=0&&f>=0;--x,--g,f-=b)
            if (q*f<p*g)
                p=f,q=g,y=w,z=x;

    printf("%d %d",y,z);
}

#include <stdio.h>

int t0,t1,t2;
double comp(int y1,int y2)
{
    double left = t0;
    double right = (double)((double)t1*y1+(double)t2*y2)/(double)(y1+y2);
    return left-right;
}

int main(void)
{
    int x1,x2;
    double temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    double state;
    temp = 9999999.0000;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state < 0.0000001 && state > -0.0000001)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(state > 0.0000001)
        {
            i--;
        }
        else
        {

            if(-state<temp)
            {
                cold = i;
                hot = j;
                temp = -state;
            }
            j--;
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>

typedef long long ll;

void solve(ll t1, ll t2, ll x1, ll x2, double t0)
{
    ll i, l, r, m, ans, y1, y2;
    double t, temp;
    if (t1 == t2)
    {
        printf("%I64d %I64d\n", x1, x2);
        return;
    }
    ans = x2;
    y1 = 0;
    y2 = x2;
    temp = t2;
    if (t1 == t0 && (t1 < temp || x1 > ans))
    {
        ans = x1;
        y1 = x1;
        y2 = 0;
        temp = t1;
    }
    for (i = 1; i <= x1; i ++)
    {
        l = 1;
        r = x2;
        while (l <= r)
        {
            m = (l + r) >> 1;
            t = (double)(t1 * i + t2 * m) / (i + m);
            if (t == t0)
            {
                if (t < temp || i + m > ans)
                {
                    temp = t;
                    y1 = i;
                    y2 = m;
                    ans = i + m;
                }
                break;
            }
            else if (t > t0)
            {
                if (t < temp || (t == temp && i + m > ans))
                {
                    temp = t;
                    y1 = i;
                    y2 = m;
                    ans = i + m;
                }
                r = m - 1;
            }
            else
            {
                l = m + 1;
            }
        }
    }
    printf("%I64d %I64d\n", y1, y2);
}

int main()
{
    int t1, t2, x1, x2, t0;
    while (scanf("%d%d%d%d%d", &t1, &t2, &x1, &x2, &t0) == 5)
    {
        solve(t1, t2, x1, x2, t0);
    }
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

#define ll long long
int GCD(int a,int b){int r; while(a){r=b; b=a; a=r%a;} return b;}

int main(){
  int i,j,k,l,m,n;
  int t1,t2,x1,x2,t0;
  double opt, tmp;
  int r1, r2;
  ll y1, y2, yy1, yy2;

  while(scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0)==5){
    opt = 1e100;

    if(t1==t0 && t2==t0){
      printf("%d %d\n",x1,x2);
      continue;
    }
    if(t1==t0){
      printf("%d 0\n",x1);
      continue;
    }
    if(t2==t0){
      printf("0 %d\n",x2);
      continue;
    }

    y2 = 1;
    REP(y1,0,x1+1){
      while(t1*y1+t2*y2 < t0*(y1+y2)){
        y2++;
        if(y2 > x2) break;
      }
      if(y2 > x2) break;

      k = GCD(y1, y2);
      if(k>1) continue;

      tmp = (t1*y1+t2*y2) / (double)(y1+y2);
      if(opt > tmp){
        opt = tmp;

        k = 1000000000;
        if(y1 && k > x1 / y1) k = x1 / y1;
        if(y2 && k > x2 / y2) k = x2 / y2;

        r1 = y1 * k;
        r2 = y2 * k;
      }
    }

    printf("%d %d\n",r1,r2);
  }

  return 0;
}

#include <stdio.h>
#include <stdlib.h>
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define abs(a) ((a < 0) ? (-a) : (a))
#define double long double

long long t1, t2, t0, x1, x2, y1, y2, y1_ans, y2_ans;
double ans = 100000000000000.0;
double eps = 0.000000000000001;

int
eq(double a, double b)
{
    return (abs(a - b) < eps);
}

int
main(void)
{
    scanf("%I64d%I64d%I64d%I64d%I64d", &t1, &t2, &x1, &x2, &t0);
    if(t2 == t0){
        y2_ans = y2 = x2;
        for(y1 = 0; y1 <= x1; ++y1){
            double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
            if(tmp < t0) continue;
            if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
                ans = tmp - (double)t0;
                y1_ans = y1;
            }
        }
        printf("%I64d %I64d", y1_ans, y2_ans);
        return 0;
    }
    for(y1 = 0; y1 <= x1; ++y1){
        y2 = ((y1 * (t0 - t1)) % (t2 - t0)) ? (y1 * (t0 - t1)) / (t2 - t0) + 1 : (y1 * (t0 - t1)) / (t2 - t0);
        if(y2 > x2) continue;
        if(y1 == 0 && y2 == 0) continue;
        double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
        if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
            ans = tmp - (double)t0;
            y1_ans = y1;
            y2_ans = y2;
        }
    }

    if(t1 == t0){
        y1_ans = y1 = x1;
        for(y2 = 0; y2 <= x2; ++y2){
            double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
            if(tmp < t0) continue;
            if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
                ans = tmp - (double)t0;
                y2_ans = y2;
            }
        }
        printf("%I64d %I64d", y1_ans, y2_ans);
        return 0;
    }

    for(y2 = 0; y2 <= x2; ++y2){
        y1 = (y2 * (t2 - t0)) / (t0 - t1);
        if(y1 > x1) continue;
        if(y1 == 0 && y2 == 0) continue;
        double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
        if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
            ans = tmp - (double)t0;
            y1_ans = y1;
            y2_ans = y2;
        }
    }
    printf("%I64d %I64d", y1_ans, y2_ans);
    return 0;
}

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>

#define MAX 100010
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)

long long int t1, t2, x1, x2, t0, r1, r2;

double F(long long int y1, long long int y2){
    long long int x = (t1 * y1) + (t2 * y2);
    long long int y = (y1 + y2);
    double res = ((1.0 * x) / (1.0 * y));
    return res;
}

bool Check(long long int y1, long long int y2){
    return ((y1 + y2) >= (r1 + r2));
}

int main(){
    int i, j, k;
    long long int y1, y2;

    while (scanf("%I64d %I64d %I64d %I64d %I64d", &t1, &t2, &x1, &x2, &t0) != EOF){
        r1 = -1, r2 = -1;
        double dif = 1e18;

        for (y1 = 0; y1 <= x1; y1++){
            long long int low = 0, high = x2;
            if (y1 == 0) low++;

            while ((low + 1) < high){
                long long int mid = (low + high) >> 1LL;
                if (F(y1, mid) <= t0) low = mid;
                else high = mid;
            }

            low -= 10, high += 10;
            for (; ;low++){
                if (low > x2) break;
                double r = F(y1, low);
                if ((r >= t0) || (fabs(r - t0) <= 1e-8)){
                    double tmp = r - t0;
                    if ((tmp < dif) && (fabs(tmp - dif) > 1e-8)) dif = tmp, r1 = y1, r2 = low;
                    else if ((fabs(tmp - dif) <= 1e-8) && Check(y1, low)) dif = tmp, r1 = y1, r2 = low;
                }
                if (low == high) break;
            }
        }

        printf("%I64d %I64d\n", r1, r2);
    }
    return 0;
}

#include<stdio.h>
#include<math.h>

#define eps 1e-12

int main() {
	int t1,t2,t0,x1,x2,i,a1,a2;
	long long j,t,ans;

	scanf("%d %d %d %d %d",&t1,&t2,&x1,&x2,&t0);
	if (t0==t2) {
		if (t0==t1) printf("%d %d\n",x1,x2);
		else printf("0 %d\n",x2);
		return 0;
	}
	ans=(long long)x2*t2,a1=0,a2=x2;
	for(i=1;i<=x1;i++) {
		j=((long long)(t0-t1)*i+(t2-t0-1))/(t2-t0);
		if (j>x2) continue;
		t=(long long)i*t1+j*t2;
		if (t*(a1+a2)<ans*(i+j) || t*(a1+a2)==ans*(i+j) && i+j>a1+a2)
			ans=t,a1=i,a2=j;
	}
	printf("%d %d\n",a1,a2);
	return 0;
}

#include <stdio.h>

int t0,t1,t2;
double comp(int y1,int y2)
{
    double left = t0;
    double right = (double)((double)t1*y1+(double)t2*y2)/(double)(y1+y2);
    return left-right;
}

int main(void)
{
    int x1,x2;
    double temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    double state;
    temp = 9999999.0000;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state < 0.000001 && state > -0.000001)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(state > 0.000001)
        {
            i--;
        }
        else
        {
            if(-state<temp)
            {
                cold = i;
                hot = j;
                temp = -state;
            }
            j--;
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>

int t0,t1,t2;
float comp(int y1,int y2)
{
    float left = t0;
    float right = (float)(t1*y1+t2*y2)/(float)(y1+y2);
    printf("%f\n",left-right);
    return left-right;
}

int main(void)
{
    int x1,x2;
    float temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    float state;
    temp = 99999.0000;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state < 0.000001 && state > -0.000001)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(i+j==1)
            break;
        else if(state > 0.000001)
        {
            i--;
        }
        else
        {
            if(-state<temp)
            {
                cold = i;
                hot = j;
                temp = -state;
            }
            j--;
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>

int t0,t1,t2;
float comp(int y1,int y2)
{
    float left = t0;
    float right = (float)(t1*y1+t2*y2)/(float)(y1+y2);
    return left-right;
}

int main(void)
{
    int x1,x2;
    float temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    float state;
    temp = 99999.0000;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state < 0.000001 && state > -0.000001)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(i+j==1)
            break;
        else if(state > 0.000001)
        {
            i--;
        }
        else
        {
            if(-state<temp)
            {
                cold = i;
                hot = j;
                temp = -state;
            }
            j--;
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>
#define abs(a) (a)>0?(a):(-a)
int t0,t1,t2;
int comp(int y1,int y2)
{
    long long left = (y1+y2)*t0;
    long long right = t1*y1+t2*y2;
    return left-right;
}

int main(void)
{
    int x1,x2;
    int temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    int state;
    temp = x1;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state == 0)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(state > 0)
        {
            i--;
            if(abs(state)<temp)
            {
                cold = i;
                hot = j;
                temp = abs(state);
            }
        }
        else
        {
            j--;
            if(abs(state)<temp)
            {
                cold = i;
                hot = j;
                temp = abs(state);
            }
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>

int t0,t1,t2;
double comp(int y1,int y2)
{
    double left = t0;
    double right = (double)((double)t1*y1+(double)t2*y2)/(double)(y1+y2);
    return left-right;
}

int main(void)
{
    int x1,x2;
    double temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    double state;
    temp = 999999.0000;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state < 0.000001 && state > -0.000001)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(i+j==1)
            break;
        else if(state > 0.000001)
        {
            i--;
        }
        else
        {
            if(-state<temp)
            {
                cold = i;
                hot = j;
                temp = -state;
            }
            j--;
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>

int t0,t1,t2;
float comp(int y1,int y2)
{
    float left = t0;
    float right = (float)(t1*y1+t2*y2)/(float)(y1+y2);
    printf("%f\n",left-right);
    return left-right;
}

int main(void)
{
    int x1,x2;
    float temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    float state;
    temp = 99999.0000;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        printf("state %f temp %f cold %d hot%d\n",state,temp,cold,hot);
        if(state < 0.000001 && state > -0.000001)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(i+j==1)
            break;
        else if(state > 0.000001)
        {
            i--;
        }
        else
        {
            if(-state<temp)
            {
                cold = i;
                hot = j;
                temp = -state;
            }
            j--;
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>

int t0,t1,t2;
double comp(int y1,int y2)
{
    double left = t0;
    double right = (double)((double)t1*y1+(double)t2*y2)/(double)(y1+y2);
    return left-right;
}

int main(void)
{
    int x1,x2;
    double temp;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    double state;
    temp = 999999.0000;
    int cold,hot;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state < 0.000001 && state > -0.000001)
        {
            cold = i;
            hot = j;
            break;
        }
        else if(state > 0.000001)
        {
            i--;
        }
        else
        {
            if(-state<temp)
            {
                cold = i;
                hot = j;
                temp = -state;
            }
            j--;
        }
    }
    printf("%d %d\n",cold,hot);
    return 0;
}

#include <stdio.h>

int t0,t1,t2;
int comp(int y1,int y2)
{
    long long left = (y1+y2)*t0;
    long long right = t1*y1+t2*y2;
    return left>right?1:(left==right?0:-1);
}

int main(void)
{
    int x1,x2;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    int state;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state == 0)
            break;
        else if(state == 1)
            i--;
        else
            j--;
    }
    printf("%d %d\n",i,j);
    return 0;
}

#include <stdio.h>

int t0,t1,t2;
int comp(int y1,int y2)
{
    long long left = t0;
    long long right = (t1*y1+t2*y2)/(y1+y2);
    return left>right?1:(left==right?0:-1);
}

int main(void)
{
    int x1,x2;
    scanf("%d%d%d%d%d",&t1,&t2,&x1,&x2,&t0);
    int i,j;
    int state;
    for(i=x1,j=x2; i>=0,j>=0;)
    {
        state = comp(i,j);
        if(state == 0)
            break;
        else if(state == 1)
            i--;
        else
            j--;
    }
    printf("%d %d\n",i,j);
    return 0;
}

#include <stdio.h>

#define INF (1LL << 50)

typedef long long ll;

void solve(ll t1, ll t2, ll x1, ll x2, double t0)
{
    ll i, l, r, m, ans, y1, y2;
    double t, temp;
    if (t1 == t2)
    {
        printf("%I64d %I64d\n", x1, x2);
        return;
    }
    temp = INF;
    y1 = y2 = ans = -1;
    for (i = 0; i <= x1; i ++)
    {
        l = 0;
        r = x2;
        while (l <= r)
        {
            m = (l + r) >> 1;
            if (i == 0 && m == 0)
            {
                l = m + 1;
                continue;
            }
            t = (double)(t1 * i + t2 * m) / (i + m);
            if (t == t0)
            {
                if (t < temp || i + m > ans)
                {
                    temp = t;
                    y1 = i;
                    y2 = m;
                    ans = i + m;
                }
                break;
            }
            else if (t > t0)
            {
                if (t < temp || (t == temp && i + m > ans))
                {
                    temp = t;
                    y1 = i;
                    y2 = m;
                    ans = i + m;
                }
                r = m - 1;
            }
            else
            {
                l = m + 1;
            }
        }
    }
    printf("%I64d %I64d\n", y1, y2);
}

int main()
{
    int t1, t2, x1, x2, t0;
    while (scanf("%d%d%d%d%d", &t1, &t2, &x1, &x2, &t0) == 5)
    {
        solve(t1, t2, x1, x2, t0);
    }
    return 0;
}

#include <stdio.h>

#define INF (1LL << 60)

typedef long long ll;

void solve(ll t1, ll t2, ll x1, ll x2, double t0)
{
    ll i, l, r, m, ans, y1, y2;
    double t, temp;
    if (t1 == t2)
    {
        printf("%I64d %I64d\n", x1, x2);
        return;
    }
    temp = INF;
    y1 = y2 = ans = -1;
    for (i = 0; i <= x1; i ++)
    {
        l = 0;
        r = x2;
        while (l <= r)
        {
            m = (l + r) >> 1;
            t = (double)(t1 * i + t2 * m) / (i + m);
            if (t == t0)
            {
                if (t0 < temp || i + m > ans)
                {
                    temp = t0;
                    y1 = i;
                    y2 = m;
                    ans = i + m;
                }
                break;
            }
            else if (t > t0)
            {
                if (t < temp || (t == temp && i + m > ans))
                {
                    temp = t;
                    y1 = i;
                    y2 = m;
                    ans = i + m;
                }
                r = m - 1;
            }
            else
            {
                l = m + 1;
            }
        }
    }
    printf("%I64d %I64d\n", y1, y2);
}

int main()
{
    int t1, t2, x1, x2, t0;
    while (scanf("%d%d%d%d%d", &t1, &t2, &x1, &x2, &t0) == 5)
    {
        solve(t1, t2, x1, x2, t0);
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define abs(a) ((a < 0) ? (-a) : (a))
#define double long double

long long t1, t2, t0, x1, x2, y1, y2, y1_ans, y2_ans;
double ans = 100000000000000.0;
double eps = 0.000000000000001;

int
eq(double a, double b)
{
    return (abs(a - b) < eps);
}

int
main(void)
{
    scanf("%I64d%I64d%I64d%I64d%I64d", &t1, &t2, &x1, &x2, &t0);
    if(t2 == t0){
        if(t1 == t0){
            printf("%I64d %I64d", x1, x2);
        } else {
            printf("0 %I64d", x2);
        }
        return 0;
    }
    for(y1 = 0; y1 <= x1; ++y1){
        y2 = ((y1 * (t0 - t1)) % (t2 - t0)) ? (y1 * (t0 - t1)) / (t2 - t0) + 1 : (y1 * (t0 - t1)) / (t2 - t0);
        if(y2 > x2) continue;
        double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
        if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
            ans = tmp - (double)t0;
            y1_ans = y1;
            y2_ans = y2;
        }
    }
    printf("%I64d %I64d", y1_ans, y2_ans);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define abs(a) ((a < 0) ? (-a) : (a))
#define double long double

long long t1, t2, t0, x1, x2, y1, y2, y1_ans, y2_ans;
double ans = 100000000000000.0;
double eps = 0.000000000000001;

int
eq(double a, double b)
{
    return (abs(a - b) < eps);
}

int
main(void)
{
    scanf("%I64d%I64d%I64d%I64d%I64d", &t1, &t2, &x1, &x2, &t0);
    if(t2 == t0){
        y2_ans = x2;
        y2 = x2;
        for(y1 = 0; y1 <= x1; ++y1){
            double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
            if(tmp < t0) continue;
            if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
                ans = tmp - (double)t0;
                y1_ans = y1;
            }
        }
        printf("%I64d %I64d", y1_ans, y2_ans);
        return 0;
    }
    for(y1 = 0; y1 <= x1; ++y1){
        y2 = ((y1 * (t0 - t1)) % (t2 - t0)) ? (y1 * (t0 - t1)) / (t2 - t0) + 1 : (y1 * (t0 - t1)) / (t2 - t0);
        if(y2 > x2) continue;
        if(y1 == 0 && y2 == 0) continue;
        double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
        if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
            ans = tmp - (double)t0;
            y1_ans = y1;
            y2_ans = y2;
        }
    }
    printf("%I64d %I64d", y1_ans, y2_ans);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define abs(a) ((a < 0) ? (-a) : (a))

long long t1, t2, t0, x1, x2, y1, y2, y1_ans, y2_ans;
double ans = 100000000000000.0;
double eps = 0.000000000001;

int
eq(double a, double b)
{
    return (abs(a - b) < eps);
}

int
main(void)
{
    scanf("%I64d%I64d%I64d%I64d%I64d", &t1, &t2, &x1, &x2, &t0);
    if(t2 == t0){
        if(t1 == t0){
            printf("%I64d %I64d", x1, x2);
        } else {
            printf("0 %I64d", x2);
        }
        return 0;
    }
    long long i;
    for(i = 0; i <= x1; ++i){
        y1 = i;
        y2 = ((y1 * (t0 - t1)) % (t2 - t0)) ? (y1 * (t0 - t1)) / (t2 - t0) + 1 : (y1 * (t0 - t1)) / (t2 - t0);
        if(y2 > x2) continue;
        if(y1 == 0 && y2 == 0) continue;
        double tmp = (double)(t1 * y1 + t2 * y2) / (double)(y1 + y2);
        if(tmp - (double)t0 < ans || (eq(tmp - (double)t0, ans) && y1 + y2 > y1_ans + y2_ans)){
            ans = tmp - (double)t0;
            y1_ans = i;
            y2_ans = y2;
        }
    }
    printf("%I64d %I64d", y1_ans, y2_ans);
    return 0;
}

#include<stdio.h>
#include<math.h>

#define eps 1e-12

int main() {
	int t1,t2,t0,x1,x2,i,j,a1,a2,tt;
	double t,tx,ans,dt,y;

	scanf("%d %d %d %d %d",&t1,&t2,&x1,&x2,&t0);
	if (t0==t2) {
		if (t0==t1) printf("%d %d\n",x1,x2);
		else printf("0 %d\n",x2);
		return 0;
	}
	ans=1e20;
	for(i=0;i<=x1;i++) {
		y=(t1-t0)/(double)(t0-t2)*i;
		if (y>x2+1.1) continue;
		tt=(int)floor(y+eps);
		j=tt;
		t=((double)i*t1+(double)j*t2)/(i+j);
		if (i+j>0 && t+eps>t0 && j<=x2) {
			dt=t-t0;
			if (dt+eps<ans) {
				ans=dt;
				a1=i,a2=j;
			} else if (dt<ans+eps) {
				if (a1+a2<i+j) a1=i,a2=j;
			}
		}
		j=tt+1;
		t=((double)i*t1+(double)j*t2)/(i+j);
		if (i+j>0 && t+eps>t0 && j<=x2) {
			dt=t-t0;
			if (dt+eps<ans) {
				ans=dt;
				a1=i,a2=j;
			} else if (dt<ans+eps) {
				if (a1+a2<i+j) a1=i,a2=j;
			}
		}
	}
	printf("%d %d\n",a1,a2);
	return 0;
}

#include<stdio.h>
#include<math.h>

#define eps 1e-12

int main() {
	int t1,t2,t0,x1,x2,i,j,a1,a2,tt;
	double t,tx,ans,dt,y;

	scanf("%d %d %d %d %d",&t1,&t2,&x1,&x2,&t0);
	if (t0==t2) {
		if (t0==t1) printf("%d %d\n",x1,x2);
		else printf("0 %d\n",x2);
		return 0;
	}
	ans=1e20;
	for(i=0;i<=x1;i++) {
		y=(t1-t0)/(double)(t0-t2)*i;
		if (y>x2+1.0) continue;
		tt=(int)floor(y+eps);
		j=tt;
		t=((double)i*t1+(double)j*t2)/(i+j);
		if (t+eps>t0 && j<=x2) {
			dt=t-t0;
			if (dt+eps<ans) {
				ans=dt;
				a1=i,a2=j;
			} else if (dt<ans+eps) {
				if (a1+a2<i+j) a1=i,a2=j;
			}
		}
		j=tt+1;
		t=((double)i*t1+(double)j*t2)/(i+j);
		if (t+eps>t0 && j<=x2) {
			dt=t-t0;
			if (dt+eps<ans) {
				ans=dt;
				a1=i,a2=j;
			} else if (dt<ans+eps) {
				if (a1+a2<i+j) a1=i,a2=j;
			}
		}
	}
	printf("%d %d\n",a1,a2);
	return 0;
}