#Lutece1267. broken equation
broken equation
Migrated from Lutece 1267 broken equation
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给你一个只包含正号(+
)负号(-
)加(+
)减(-
)乘(*
)整除 (/
),括号((
和)
)还有数字(0123456789
)和恰好一个问号(?
)的等式,求问号的值,使得等式成立。
注意,有前导0的数字算非法。
Input
一个等式,长度不超过,并且有且只有一个问号(?
).
Output
取代了问号之后的等式,如果有多组解,输出最小字典序解,如果无解,输出-1
。
Samples
?++3=4
1++3=4
1?3=4
1+3=4
Resources
咦。。