OpenKattis
Kattis Set 11

Start

2019-04-01 13:00 UTC

Kattis Set 11

End

2019-04-08 09:29 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -225 days 20:06:31

164:29:59

0:00:00

Problem ACalculator

Input

Input contains several test cases, one per line. Each test case consists of an expression to be evaluated, containing numbers, parenthesises, and the operators $+,-,*,/$.

Normal operator precedence applies, so multiplication and division bind harder than addition and subtraction. All operators evaluate left-to-right. Implicit multiplication is not possible, so $3(1+1)$ is not a valid input. There may be an arbitrary amount (including 0) of spaces between tokens. Numbers are integers with absolute value at most 500.

Input is terminated by EOF.

Output

For each test case, output the value of the expression, with two decimals of precision.

Sample Input 1 Sample Output 1
5 - 3-2
5- (3-2)
5 / 3 / 2
5 / (3 / 2)
1/3+1
1/(3+1)
-4--2
(1-3)/(5+4)
2*3*5*7*11*13*17*19
-5/-5

0.00
4.00
0.83
3.33
1.33
0.25
-2.00
-0.22
9699690.00
1.00