시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1279 916 849 73.955%

문제

겨울 방학에 달에 다녀온 상근이는 여름 방학 때는 화성에 갔다 올 예정이다. (3996번) 화성에서는 지구와는 조금 다른 연산자 @, %, #을 사용한다. @는 3을 곱하고, %는 5를 더하며, #는 7을 빼는 연산자이다. 따라서, 화성에서는 수학 식의 가장 앞에 수가 하나 있고, 그 다음에는 연산자가 있다.

입력

첫째 줄에 테스트 케이스의 개수 T가 주어진다. 다음 줄에는 화성 수학식이 한 줄에 하나씩 주어진다. 수학식은 100자를 넘지 않는다.

출력

각 테스트 케이스에 대해서, 화성 수학식의 결과를 계산한 다음에, 소수점 둘째 자리까지 출력한다.

예제 입력 1

3
3 @ %
10.4 # % @
8 #

예제 출력 1

14.00
25.20
1.00
W3sicHJvYmxlbV9pZCI6IjUzNTUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQ2NTRcdWMxMzEgXHVjMjE4XHVkNTU5IiwiZGVzY3JpcHRpb24iOiI8cD5cdWFjYThcdWM2YjggXHViYzI5XHVkNTU5XHVjNWQwIFx1YjJlY1x1YzVkMCBcdWIyZTRcdWIxNDBcdWM2MjggXHVjMGMxXHVhZGZjXHVjNzc0XHViMjk0IFx1YzVlY1x1Yjk4NCBcdWJjMjlcdWQ1NTkgXHViNTRjXHViMjk0IFx1ZDY1NFx1YzEzMVx1YzVkMCBcdWFjMTRcdWIyZTQgXHVjNjJjIFx1YzYwOFx1YzgxNVx1Yzc3NFx1YjJlNC4gKDxhIGhyZWY9XCJodHRwOlwvXC93d3cuYWNtaWNwYy5uZXRcL3Byb2JsZW1cLzM5OTZcIj4zOTk2XHViYzg4PFwvYT4pIFx1ZDY1NFx1YzEzMVx1YzVkMFx1YzExY1x1YjI5NCBcdWM5YzBcdWFkNmNcdWM2NDBcdWIyOTQgXHVjODcwXHVhZTA4IFx1YjJlNFx1Yjk3OCBcdWM1ZjBcdWMwYjBcdWM3OTAgQC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