Make a polyglot generator 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)=&gt;`1//1;'''
console.log(${x})
//''';print(${y})`

Your score would be \$\frac{53}{2^{2}}\$ = 13.25.
The lower your score, the better.
Python 3, 167 bytes, produces Python 3.0, 3.1, ..., 3.9, 3.10, \${167 \over 11^2}\approx1.38\$
thanks to SuperStormer for refreshing my memory, allowing to add 3.10.

lambda r:'try:exec(&quot;%s&quot;);o=%d\nexcept:0\n'*10%sum(zip(&quot;0;int.bit_length;callable;u'';import enum;b''%();f'';breakpoint;(a:=0);{}|{}&quot;.split(';'),r),())+'print(o)'

Try it online!
This works by trying to evaluate expressions code that rely on new language features and updating the output value if successful. By including more subversions, the score could probably be decreased by quite a bit.




Version
Code
New Language feature




3.1
int.bit_length
New builtin


3.2
callable
New builtin


3.3
u''
Old syntax for unicode strings re-added from Python 2


3.4
import enum
New module called enum


3.5
b''%()
String formatting with % for bytes objects


3.6
f''
f-strings


3.7
breakpoint
New builtin function


3.8
(a:=0)
Assignment expressions


3.9
{}|{}
Dictionary union with |


3.10
a:x=0
postponed evaluation of annotations is now enabled by default