I multiply the source, you (probably) multiply the output! Task

The task is to write a program that outputs a consistent but otherwise arbitrary positive integer \$x\$ (so strictly greater than 0). Here's the catch: when the source is repeated \$N\$ times (the code is appended/concatenated \$N-1\$ to itself), the program should have a \$\dfrac{1}{N}\$ probability of outputting \$N\cdot x\$ and the remaining probability of \$\dfrac{N-1}{N}\$ of outputting \$x\$ unchanged.

Example

Let's assume that your initial source is XYZ and produces the integer 3. Then:


For \$N=2\$: XYZXYZ should output \$3\$ with a probability of \$\frac{1}{2}\$ (50% of the time) and \$2\cdot 3=6\$ with a probability of \$\frac{1}{2}\$ as well (50% of the time).
For \$N=3\$: XYZXYZXYZ should output \$3\$ with a probability of \$\frac{2}{3}\$ (66.666% of the time) and \$3\cdot 3=9\$ with a probability of \$\frac{1}{3}\$ (33.333%  of the time)
For \$N=4\$: XYZXYZXYZXYZ should output \$3\$ with a probability of \$\frac{3}{4}\$ (75% of the time) and \$4\cdot 3=12\$  with a probability of \$\frac{1}{4}\$ (25% of the time)


and so on....

Rules


You must build a full program. The output has to be printed to STDOUT.
Your program, should, in theory, output each possible value with the probabilities stated above, but a slight deviation from this due to the implementation of random is fine (provided that the implementation is not of a different distribution - you can't use a normal distribution to save bytes).
The program should (again, in theory) work for an arbitrarily big value of \$N\$, but technical limitations due to precision are fine for large \$N\$.
The output must be in base 10 (outputting in any other base or with scientific notation is forbidden). Trailing / leading spaces and leading zeroes are allowed.
The initial source must (of course) be at least 1 byte long. You may not assume a newline between copies of your source. The program should not take input (or have an unused, empty input). 
This is code-golf, so an answer's score is the length of the (original) source in bytes, with a lower score being better.


Note: This challenge is a (much) harder version of this one.
R, 66 35 bytes

-29 bytes thanks to digEmAll.

-2 bytes thanks to Giuseppe.



+0-&gt;A
x=!0:F
F=F+1
sample(F*x+!x,1)


Try it online!

Check the distribution for N=4.

The key is the rightwards assignment -&gt;. When the code is multiplied \$N\$ times, the first \$N-1\$ calls to sample will be assigned to A, and only the last call will be printed.

Original, more convoluted solution:

R, 66 bytes



T-&gt;TT
F=F+1
TT=0
`?`=function(x)if(x)sample(c(1,F),1,,c(1,F-1))
?T


Try it online!

Try it online (repeated 3 times)!

Uses two tricks: 1) call the main function of interest ?, so that we can call it without ending the program with a bracket, and 2) use variables T and TT, with code which starts with T and ends with ?T.

F is the iteration counter. ? is redefined as a function which takes a boolean argument: if the input of ? is TRUE (or T), it does the required random sampling; if the input is FALSE (or 0), it does nothing. The value of TT is defined as 0, so that ?T does the sampling but ?TT does nothing.

When the source is repeated, it looks like this:

T-&gt;TT
F=F+1
TT=0
`?`=function(x)if(x)sample(c(1,F),1,,c(1,F-1))
?TT-&gt;TT
F=F+1
TT=0
`?`=function(x)if(x)sample(c(1,F),1,,c(1,F-1))
?T


so the middle call ?TT outputs nothing but the final call ?T outputs the random result.