Problem C. Penalty time counts
Description
As we all know, in ACM series, a very important basis for ranking is penalty time.
Xiaohan, a new engineer, has developed an evaluation system. The calculation method of
penalty time of the system is as follows:
1. For each passed topic, the system will record the time a of the first pass and the
number B of submissions that failed before, generate the corresponding string A + B
(excluding quotation marks), and the corresponding contribution is A + B × 20.
2. For other failed topics, the system will record the failed submission times C, generate
a string - C (excluding quotation marks), and the corresponding contribution is 0.
Now Xiaohan has developed the function of generating string. He hopes you can help
him realize the function of calculating the corresponding contribution through the string
generated by the system.
Input
The first line is only an integer n, which indicates the number of generated strings.
From line 2 to line n + 1, each line is a string in the same format as the topic description,
i.e. in the form of A+B or -C (excluding quotation marks).
Considering the actual situation, we ensure that all input data meet 1 ≤ n ≤ 20, 0 ≤ A, B,
C ≤ 300.
Output
Output n lines, one integer per line. The integer in line I represents the penalty time of
the contribution corresponding to the ith string.
Samplem Input
5
16+0
160+20
-3
255+6
-0
Samplem Ouput
16
560
0
375
0