Four OperationsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 916 Accepted Submission(s): 199
Problem Description Little Ruins is a studious boy, recently he learned the four operations!
Now he want to use four operations to generate a number, he takes a string which only contains digits '1' - '9', and split it into $5$ intervals and add the four operations '+', '-', '*' and '/' in order, then calculate the result(/ used as integer division).
Now please help him to get the largest result.
Input First line contains an integer $T$, which indicates the number of test cases.
Every test contains one line with a string only contains digits '1'-'9'.
Limits $1 \leq T \leq 10^5$ $5 \leq \text{length of string} \leq 20$
Output For every test case, you should output 'Case #x: y', where x indicates the case number and counts from 1 and y is the result.
Sample Input
Sample Output Statistic | Submit | Clarifications | Back
|