A polyglot is a program that runs in several languages.
Your challenge is to:
Choose at least two languages (Different versions count as different languages)
Create a program or function that takes several positive integers (one for each language you chose) and returns a program that:
Is a valid program in all of those languages
When run in language A, outputs the first number; When run in language B, outputs the second number; etcetera. Exiting by error is allowed, as long as the generated program prints the number first
The generator does not need to be in one of your chosen languages.
You can assume the inputted numbers within your chosen languages' limits. For example, if BF is one of your languages, the number for BF will be at most 255.
UPDATE
Explicitly checking the version number or implementation of the language is forbidden. To differentiate, use differences in language features.
Scoring
Your score is [code length] / [number of languages]2.
Example:
Let's say you were using JS/Python 3, in a JS program:
(x,y)=>`1//1;'''
console.log(${x})
//''';print(${y})`
Your score would be \$\frac{53}{2^{2}}\$ = 13.25.
The lower your score, the better.