k+1 people at L+5000
k people at L+10000
there is nobody earning L.
But the range is 10000, so both endpoints must exist:
* one person at L
* one person at L+10000
That changes everything.
So for odd N = 2k+1:
To maximize average while keeping median = L+5000:
* one person at L
* as many as possible at L+5000
* remaining at L+10000
Structure becomes:
1 person at L
k people at L+5000
k people at L+10000
Why?
Because:
* total people = 2k+1
* median (the middle person) must still be L+5000
* only k people can be above median
Now compute average excess above L:
[0 + 5000k + 10000k] / (2k+1)
= 15000k / (2k+1)
Set equal to 7000:
\frac{15000k}{2k+1}=7000
Solve:
15000k = 14000k + 7000
1000k = 7000
k = 7
Thus:
N = 2k+1 = 15