|
|
Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language
version or invalid test data, or description of the problem is not clear.
SPOJ Problem Set (main)
5671. Roman calculator
Problem code: ROMANCAL
|
Given string a and string b your task is to calculate sum, difference, product, quotient or remainder depending on given char c.
Input
The first line of the standard input contains one integer t (t<101) which is the number of test cases.
In each of the next t lines there are string a (I<=a<=V*M), char c ('+', '-', '*', ':' or '%') and string b (I<=b<=V*M).
Output
For each test, print sum if c='+', difference if c='-', product if c='*', quotient if c=':', remainder if c='%' or ERROR if the result equals 0. If the result is negative print '-' in front of it. The result will be integer.
Example
Input: 6 II + III II - III II * III VI : III V % III I - I Output: V -I VI II II ERROR
|
|
|
|