406620: GYM102461 A Expression Formatting
Description
Masha is learning programming, but her teacher always says that she is doing wrong, and her code is not pretty enough. For instance, Masha doesn't like spaces, and she never uses spaces inside expression, for example: (a+b)*c.
The teacher tries to make Masha put the spaces around binary operators, for the expression to look like: (a + b) * c. Masha doesn't want to waste time on such stupid things, so she asks you to write a program that is putting spaces for her.
InputThe first line contains the expression that needs to be fixed. The expression consists of variable names, binary operators: '+', '-', '*', '/', and parentheses: '(', ')'. The expression doesn't contain any space, and is correct. All variables consist of a single lowercase English letter. The length of the expression string doesn't exceed 200.
OutputPrint the same expression, adding a single space before and after each binary operator.
ScoringTesting data for this problem consists of 20 test cases. For solving each test case you are awarded 5 points. Total score is the total sum of points for all test cases. The testing result for each test case is shown.
ExamplesInputa+bOutput
a + bInput
((a))-b+(c*(d))Output
((a)) - b + (c * (d))Input
(a)/(b-b)+((d)+((c)))Output
(a) / (b - b) + ((d) + ((c)))