[Question]
  [
Well, everyone loves **[Polyglots](https://codegolf.stackexchange.com/tags/polyglot/info)**. 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` and `STDERR` or any other `return` method)
* See the *Output specs* section for more details about formatting
---
## Input
As stated above, two integers taken as input in any **[standard method](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods)**, 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 be `min_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](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so try to write the shortest code to get the desired results, while taking note that **[Standard Loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default)** 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)
  
[Answer]
# C and C++ (gcc), ~~117~~ 107 bytes
*-10 bytes thanks to @Steadybox!*
```
#include<stdio.h>
int f(int a,int b){auto c=.5;a-b&&printf("%d %d",c?b<a?b:a:a>b?a:b,c?a-b>0?a-b:b-a:a+b);}
```
**Explanation:** In C, `auto c=.5` declares an integer variable with the auto storage class (which is the default), which is then initialized to 0, whereas in C++11 it declares a double, which is initialized to 0.5. So the variable's value will be truthy in C++ and falsy in C.
**C - max language:** [Try it online!](https://tio.run/nexus/c-gcc#VcxBDoMgEIXhvacgNBpIwaDRDVg9y4zUlKRFU2FlPLuFZTd/Jl9e5ro5P7@jfQ57sG6tX2PhfCALywWRi/yAGFYyP@regMSq2r7JF0ZLS0pLxTzhABNq0DDiBBqTpN2ocjXK5Hfk5rzytw84z/hRLKxRSnSKmy2GnVHKTbK2EW3zT7LrhezTeV4/ "C (gcc) – TIO Nexus")
**C++ - min language:** [Try it online!](https://tio.run/nexus/cpp-gcc#VcxBDoMgEIXhvacgNBpIwaDRDVg9y4zUlKRFU2FlPLuFZTd/Jl9e5ro5P7@jfQ57sG6tX2PhfCALywWRi/yAGFYyP@regMSq2r7JF0ZLS0pLxTzhABNq0DDiBBqTpN2ocjXK5Hfk5rzytw84z/hRLKxRSnSKmy2GnVHKTbK2EW3zT7LrhezTeV4/ "C++ (gcc) – TIO Nexus")
[Answer]
# [Python 3](https://docs.python.org/3/) / [Jelly](https://github.com/DennisMitchell/jelly), 42 bytes
Using Jelly's [code-page](https://github.com/DennisMitchell/jelly/wiki/Code-page) to encode the file.
Raw bytes:
```
6c 61 6d 62 64 61 20 78 2c 79 3a 5b 6d 61 78 28    lambda x,y:[max(
78 2c 79 29 2c 78 2b 79 5d 2a 28 78 21 3d 79 29    x,y),x+y]*(x!=y)
0a 23 7f fa 2c d3 f7 d3 cd 04                      .#.ú,Ó÷ÓÍ.
```
Both define an unnamed dyadic function.
Python (the max language) sees:
```
lambda x,y:[max(x,y),x+y]*(x!=y)
#\x7fú,Ó÷ÓÍ\x04
```
[Tests as Python](https://tio.run/nexus/python3#S7ON@Z@TmJuUkqhQoVNpFZ2bWKEBZGjqVGhXxmppVCjaVmpyKcdUmKcd3qVzePLh7UDcG1NhYPI/Lb9IoSS1uEQhM08hOtrQwEDHxCBWJ9rMWMfMHEjrmpjq6JoCGUaGOkaGIAFDHcPYWCsuzoKizLwSDZBWHQX1mBJ1HYU0DS0QV1PzPwA).
Jelly (the min language) sees:
```
lambda x,y:[max(x,y),x+y]*(x!=y)½#
«,ạẋạṠ¥
```
[Tests as Jelly](https://tio.run/nexus/jelly#@5@TmJuUkqhQoVNpFZ2bWKEBZGjqVGhXxmppVCjaVmoe2qvMdWi1zsNdCx/u6gaROxccWvo/OtrQwEDHxCBWJ9rMWMfMHEjrmpjq6JoCGUaGOkaGIAFDHcPY2KN7Di/Xf9S0xhuI3f8DAA).
### How?
Jelly interprets 0x0a as `½`, the square root atom while Python interprets it as a newline. In Jelly 0x7f is interpreted as a separation between links (functions) and is represented by either a newline or a pilcrow in it's codepage. For Jelly the last link is the main function - here it does not call the link above (which the interpreter does still need to parse correctly). In Python 0x23, `#` instructs that anything after it and before 0x0a, a newline, is a comment.
The Python code that gets executed:
```
lambda x,y:[max(x,y),x+y]*(x!=y)
lambda x,y:                      - A function taking two inputs, x and y
           [        ,   ]        - A list with two items
            max(x,y)             - take the maximum of x and y
                     x+y         - x plus y
                           x!=y  - x not equal to y?
                         *(    ) - multiply - True is treated as if it were 1, False as if it were 0
```
The Jelly code that gets executed:
```
«,ạẋạṠ¥ - A dyadic link (function of two variables): x, y
«       - minimum(x, y)
  ạ     - absolute difference(x, y)
 ,      - pair left with right (creating a list)
      ¥ - last two links as a dyad:
     ạ  -     absolute difference(x, y)
    Ṡ   -     sign(result) (i.e. {0:0, +x:1, -x:-1} but -x never happens)
   ẋ    - repeat the list to the left right times (either the same list or an empty list)
        - return the result
```
[Answer]
# Ruby / Python 3, 102 bytes
Ruby returns max/sum, Python returns min/difference. Input is an array object read from STDIN.
```
a=eval((0and gets or input()))
b=a.sort()
x,y=(b or a)
z=0 or 1
x==y or print([[y,x][z],[x+y,y-x][z]])
```
[Try it online: Ruby](https://tio.run/nexus/ruby#HcnBCsIwDIDhe58i3lKMMhHmKU8SeuhwSkG60VVJ9vLVevs//hZ5/sQX4hDzHZ5z3WApkPL6rui9dxPH87aUH5ySMU59R@92HnpdnDJbr7WkXFHESIPsgUSPRnb6I/j0AD2wtSbjlWC8hS8)
[Try it online: Python](https://tio.run/nexus/python3#HcnBCoMwDIDhe5@ixwSz4RD0lCcJPUQmQxhVah2NL9@tu/0ff1VePvoG6DU@/WvJh9@SX@N@ZkBEN7Pejy394AoZw9y2oru4b/Vwhdla7WmNGUSMSpArkJTOyG5/BKxVxoH8OIUv)
The main quirk used here is the use of the truthy `0` in Ruby, which is falsy in Python. The other thing worth mentioning is that Python's `sort` function modifies the list in-place and returns `None`, while Ruby's doesn't and returns the sorted array, hence the need to use `b or a` to get the min/max.
Python 3 is required because Python 2 complains if you try to call `print` after the `or` statement in the last line.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E) / [Jelly](https://github.com/DennisMitchell/jelly), ~~21~~ 20 bytes
-1 byte after asking for some help - thanks Emigna! (``` will `push(uwrapped(pop()))`)
Raw bytes (the dump to the right shows what my Windows machine displays):
```
60 ca 69 b9 5a 73 4f 29 71 93 18 fa 2c d3 f7 d3    `Êi¹ZsO)q..ú,Ó÷Ó
cd 04 18 2f                                         Í../
```
Both take input from STDIN and output to STDOUT as a list representation `[x, y]`.
The max language is 05AB1E:
```
`Êi¹ZsO)q“.ú,Ó÷ÓÍ../
```
Where the `.` represent unprintable bytes in it's codepage ([cp1252](https://en.wikipedia.org/wiki/Windows-1252)), and probably here in whatever you are using (0x18=`CAN` and 0x04=`EOT`).
Try the [05AB1E version](https://tio.run/nexus/05ab1e#@59wuCvz0M6oYn/NwkcNcyQO79I5PPnwdiDuZZHQ//8/WtfEVEdB1zSWCwA)
The min language is Jelly:
```
İ__iỤZs0)qƓð«,ạẋạṠ¥ð/
```
Try the [Jelly version](https://tio.run/nexus/jelly#@59wYl3mw91LoooNNAuPTT684dBqnYe7Fj7c1Q0idy44tPTwBv3//6N1TUx1FHRNY7kA).
### How?
05AB1E:
```
`Êi¹ZsO)q“.ú,Ó÷ÓÍ../ - parsed left to right, executed as parsed
                     - implicit input taken
  i                  - If:
`                    -     push(unwrapped(pop()))
 Ê                   -     push(pop()!=pop())
                     - ...Then:
   ¹                 -     push(1st item from input history)
    Z                -     push(max(top of stack))
     s               -     push(reverse(pop(),pop()))
      O              -     push(sum(pop()))
       )             -     wrap(pop())
        q            -     quit - implicit print of top of stack
         “.ú,Ó÷ÓÍ../ - unexecuted and unparsed string
```
Jelly:
```
`ȮiỤZs0)qƓð«,ạẋạṠ¥ð/ - parsed left to right, not executed until parsed
`ȮiỤZs0              - a dyadic chain which would error if executed (monad from dyad, index of, grade up, transpose, split into chunks of length 0)
       )q            - currently unassigned code points each currently creates a new link
         Ɠ           - read and evaluate a line of input
          ð       ð  - dyadic chain separations
                   / - reduce by:
           «         -     minimum(left, right)
             ạ       -     absolute difference(left, right)
            ,        -     pair(result)
                 ¥   -     last two links as a dyad:
               ạ     -         absolute difference(left, right)
                Ṡ    -         sign(result) (i.e. {0:0, +x:1, -x:-1} but -x never happens)
              ẋ      -     repeat list left right times
                     - implicit print
```
[Answer]
# Java/[AWK](https://www.gnu.org/software/gawk/manual/gawk.html), ~~219~~ ~~217~~ ~~212~~ 196 bytes
```
/*#\/* /
{$0=((x=$1)<y=$2)?x" "y-x:y" "x-y}x!=y
#*/interface B{static void main(String[]A){Integer x=Integer.parseInt(A[0]);int y=x.parseInt(A[1]);System.out.print(x==y?"":(x<y?y:x)+" "+(x+y));}}
```
[Try it online!](https://tio.run/nexus/awk#TU67jsIwEOz9FXshhZ3IiR0eJwWsCLqrKYEiAh9yQUCJ77SrKN@e2@IKmnlpNJq5zBbnMoNSjKlxUqJLrdqRSyvVYAIJaayJGTVN@OFILLIydNH33@3Vw2EcYhvDFX6f4QaPNnTyGPvQ3U@XvRq/uHf3PaD7V8Wr7QfPRu5P5qK2PATk8D22HB9piP5RPH9i8eKxyKccNUlSS9xRQzWqnB/lEnNSajtNYp6tMbAyYrOEzafQqzXotagsVFZoRi78AQ "AWK – TIO Nexus")
Java outputs the max and sum, AWK outputs min and difference. No output for either if the inputs are identical. 
This is my first polyglot and first TIO :)
[Answer]
# JavaScript (ES6)/ QBasic, ~~172~~ 171 bytes
```
'';f=x=>{m=Math.max(...x);s=Math.min(...x);if(x[0]!=x[1])alert([m,m-s])}/*
INPUT c
LET m=c
LET s=c
INPUT n
IF n>c THEN m=n
IF n<c THEN s=n
IF n<>c THEN PRINT m,m+s
END
'*/
```
Based on [this solution of mine](https://codegolf.stackexchange.com/questions/116890/plus-or-minus-polyglots/117069#117069) of a similar [polyglot](/questions/tagged/polyglot "show questions tagged 'polyglot'") question.
This solution too use the comment approach!
JavaScript is the min-language. It takes in an array containing numbers as input. Outputs two numbers separated by `,` (1st number is the smallest value of the input-array and 2nd number is the difference of the greatest and the smallest values of the input-array) by `alert()`ing. Does not `alert()` anything if the numbers are equal. You can call the function like `f([100,40])`.
QBasic is the max-language. Repeatedly asks for input, twice. Prints the largest number of the input-numbers as well as the sum of largest and smallest numbers of the input. Does not `PRINT` anything if the numbers are equal.
---
## How does it work?
In QBasic (a language of structured BASIC family; it does not require line numbers), `'` marks the beginning of a comment which goes till the end of the line. Whereas in JavaScript, it marks the start of a string. So, the whole first line is marked as a comment in QBasic but in JavaScript, the line is executed (and this line contains the JavaScript part that computes the smallest number and the difference of greatest and smallest numbers, as well as a `/*` at the end which starts a comment in order to hide the rest of the QBasic code from JavaScript interpreter.)
The code from second line to second-last line contains the QBasic code to compute the greatest number and the sum of greatest and smallest number (the code is very self-explanatory).
The last line contains `'*/`. `'` causes the QBasic interpreter to interpret the following code as a comment, whereas in JavaScript, it does not have any effect as it is a part of a comment (which was started at the end of the first line). The following code (`*/`) causes JavaScript to end the comment which was started in the first line, but it is not executed in QBasic because QBasic thinks it's a part of a comment.
---
## Test Cases
**JavaScript (min-language):**
```
'';f=x=>{m=Math.max(...x);s=Math.min(...x);if(x[0]!=x[1])alert([m,m-s])}/*
INPUT c
LET m=c
LET s=c
INPUT n
IF n>c THEN m=n
IF n<c THEN s=n
IF n<>c THEN PRINT m,m+s
END
'*/
f([100,40]);
```
**QBasic (max-language):**
Go to [this website](http://yohan.es/swbasic/). Copy paste the following code in their text-editor :
```
1 '';f=x=>{m=Math.max(...x);s=Math.min(...x);if(x[0]!=x[1])alert([m,m-s])}/*
2 INPUT c
3 LET m=c
4 LET s=c
5 INPUT n
6 IF n>c THEN m=n
7 IF n<c THEN s=n
8 IF n<>c THEN PRINT m,m+s
9 END
10 '*/
```
The reason why line numbers are required is that the website I mentioned only supports unstructured BASIC languages. And that website is the only decent online BASIC interpreter I could find. However, running the code present in the top of the post (the code without line numbers) should work fine in any good QBasic interpreter that supports structured BASIC and `'` as a comment-starter (few do not, most do, though)
]