300304: CF58E. Expression
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Expression
题意翻译
题意 给定一个形如$x+y=z$ 的(不一定正确)的等式,求一个尽量短的形如$a+b=c$ 的正确的等式,使得擦去其中的若干数字后能够得到$x+y=z$ 。如果有多组方案,输出任意一组。 输入的三个数字$x,y,z$ 均不含前导零。 Translated by @_rqy题目描述
One day Vasya was solving arithmetical problems. He wrote down an expression $ a+b=c $ in his notebook. When the teacher checked Vasya's work it turned out that Vasya had solved the problem incorrectly. Now Vasya tries to find excuses. He says that he simply forgot to write down several digits in numbers $ a $ , $ b $ and $ c $ , but he can't remember what numbers they actually were. Help Vasya, find such numbers $ x $ , $ y $ and $ z $ , with which the following conditions are met: - $ x+y=z $ , - from the expression $ x+y=z $ several digits can be erased in such a way that the result will be $ a+b=c $ , - the expression $ x+y=z $ should have the minimal length.输入输出格式
输入格式
The first and only input line contains the expression $ a+b=c $ ( $ 1<=a,b,c<=10^{6} $ , $ a $ , $ b $ and $ c $ don't contain leading zeroes) which is the expression Vasya wrote down.
输出格式
Print the correct expression $ x+y=z $ ( $ x $ , $ y $ and $ z $ are non-negative numbers without leading zeroes). The expression $ a+b=c $ must be met in $ x+y=z $ as a subsequence. The printed solution should have the minimal possible number of characters. If there are several such solutions, you can print any of them.
输入输出样例
输入样例 #1
2+4=5
输出样例 #1
21+4=25
输入样例 #2
1+1=3
输出样例 #2
1+31=32
输入样例 #3
1+1=2
输出样例 #3
1+1=2