Well, everyone loves Polyglots. You will be given two integers, in any standard form of input (no hardcoding). Your task is to write a polyglot which finds the minimum value in a language and the maximum value between the two numbers in the other language, and performs the following operations:
- The code which finds the maximum value must also compute their sum.
- The program which finds the minimum value must also compute the result of their subtraction (
max - min
) - Here is the "tricky part": If the two numbers are equal, both the programs must not output/ return anything (both to
STDOUT
andSTDERR
or any otherreturn
method) - See the Output specs section for more details about formatting
Input
As stated above, two integers taken as input in any standard method, common to both languages.
Output specs
- For the program which finds the
max
, the format should be:max_value, addition result
- For the program which finds the
min
, the format should bemin_value, subtraction result (max - min)
- The results can be printed, with any clear delimiter (
\n
,,
or whatever else you want), returned from the function as a string containing the two expected values with a delimiter or as a list of numbers (e.g:[max_value,sum]
)
Examples:
Input || Max Language Output || Min Language Output
100, 40 || 100, 140 || 40, 60
63, 67 || 67, 130 || 63, 4
-45, -5 || -5, -50 || -45, 40
21, 21 || ||
-1, 1 || 1, 0 || -1, 2
Scoring:
This is code-golf, so try to write the shortest code to get the desired results, while taking note that Standard Loopholes are strictly disallowed. You must use two different languages, not other versions of the same language (e.g: Python 2
-Python 3
pairs are not valid)