NASIO - Broken Calculator
Abdullah has a calculator of NASIO brand. (Why NASIO not CASIO is one of the top 10 questions science cannot answer.)
For the last few days his calculator is giving some weird answers while doing any mathematical operations. Some examples are:
- 1 - 1 = 15
- 2 + 2 = 65
- 3 - 3 = 11
- 4 + 4 = 113
- 5 + 7 = 163
- 12 - 4 = 97
- 23 * 11 = 36196
- 5 / 2 = 19.115385
Given the operation find what Abdullah's calculator will show.
NOTE: For a division operation Abdullah's calculator rounds up his result 6 digits after decimal point, and for others he just prints a integer what his system gives.
Input
First line contains an integer 0 < t < 10000, number of testcases.
Next t lines contains the operations in any of these formats:
- a + b
- a - b
- a * b
- a / b
where a and b are non-negative integers less than 106.
See sample test case for better clarifications.
Output
For each testcase on separate line print what Abdullah's calculator with show.
Example
Input: 4 1+2 2*3 3/4 4-5 Output: 54 875 17.634615 -4
hide comments
RR:
2022-12-20 03:00:51
I don't get why SPOJ allow a user who solved only 7 problems to become problem setter. And now we have this kind of problem in classical. |
|
deddyext:
2020-11-11 09:51:14
so challenging ! Last edit: 2020-11-11 09:51:43 |
|
nadstratosfer:
2020-07-30 22:52:28
This definitely belongs in Riddle. |
|
David:
2020-07-30 18:23:47
Riddle Last edit: 2023-08-13 05:41:43 |
|
nathanaxel:
2020-03-03 16:16:19
its hard
|
|
hodobox:
2020-01-07 00:55:13
This probably belongs into riddle. |
|
akjol2049:
2019-01-02 10:25:44
any hint? |
Added by: | Safayet |
Date: | 2018-11-19 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |