F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Without Zero

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 554    Accepted Submission(s): 240


Problem Description
Everyone is familiar to the natural number system: 1, 2, 3бн Today we will consider a different one: a no-zero number system, which means it only uses the digits 1 through 9. So counting begins with 1, the first "counting number", and continues: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12бн, 19, 21бн, 98, 99, 111, 112бн
So, in this system 9 is the ninth counting number and 11 is the tenth counting number. As usual, addition can be defined by reference to the counting sequence. Addition of the i-th counting number and the j-th counting number is defined to mean the (i+j)-th counting number. Thus, in this system 5 + 8 = 14, since 5 is the fifth counting number, 8 is the eighth, and 14 is the thirteenth counting number. Subtraction is the reverse of addition.
Here is your task, given two numbers: a and b, you should output a subtract b which is defined in no-zero number system.
 

Input
Multiple test cases, each line contains two positive integers: a and b, 1 <= b < a < 1000000000, it is guaranteed that both a and b will not contain digit 0.
 

Output
One line for each case, the result of a subtract b which is defined in no-zero number system.
 

Sample Input
14 5 111 99 191 111
 

Sample Output
8 1 79
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-31 05:50:03, Gzip enabled