提示: 欢迎访问OurACM平台。
Problem 1339 Calculator

Accept: 233    Submit: 809
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Today the teacher give out a tedious homework to loy concerning the integer calculation practice. He is not contend with such boring homework, so instead, loy decides to write a program to help him finish the homework.

The expression is consists of only integers,+,-,*,/,( and ). The brackets is guaranteed to be exactly matched. And the operator / returns the integer part of the division, i.e. 7/2=3. It is guaranteed that the divisor is not zero.

Input

The first line of the input contains a single integer t, representing the number of testcase. The following t lines contains expressions one per line. There is no extra spaces in the expression. And the total length of the expression will not exceed 200.

Output

For each case, output a integer representing the result of the expression.

Sample Input

2 1+3/2 1-(2+(3*(4/5)))

Sample Output

2 -1

Source

LOY

Submit  Back  Status  Discuss