Remote computation

The alien species use remote machines for all their computation needs. Pandora managed to hack into one, but broke its functionality in the process. Incoming computation requests need to be calculated and answered rapidly, in order to not alarm the aliens and ultimately pivot to other parts of their network. Not all requests are valid though, and appropriate error messages need to be sent depending on the type of error. Can you buy us some time by correctly responding to the next 500 requests?

python3 -m pip install pwntools

python3 computation.py

...
[499]: 20 - 7 * 6 - 21 + 30 * 16 / 22 - 9 / 28 = ?

-21.5

[500]: 13 / 21 + 24 * 14 * 21 = ?

MEM_ERR

[*] Good job! HTB{d1v1d3_bY_Z3r0_3rr0r}
[*] Closed connection to 139.59.176.230 port 32592

Excellent.