A dielectric effectively behaves as if it was thicker than it is. If the dielectric constant is $K$ and the thickness of the dielectric is $t$, then for calculating the force it behaves as if the thickness was $t\sqrt{K}$.
To see this let's take the example we know about where the dielectric fills the space between the charges:
In (a) the thickness of the dielectric is the same as the distance between the charges, $r$, so the effective thickness is $r\sqrt{K}$. If we put this in the force law we get:
$$ F = \frac{1}{4\pi\epsilon_0}\frac{Q_1Q_2}{(r\sqrt{K})^2} = \frac{1}{4\pi\epsilon_0}\frac{1}{K}\frac{Q_1Q_2}{r^2} $$
as we expect. The force is reduced by a factor of $K$.
Now consider (b). To get the effective distance between the charges we have to add the distance through the air, $r - t$, plus the effective thickness of the dielectric, $t\sqrt{K}$, so the effective distance between the charges is:
$$ d = (r - t) + t\sqrt{K} $$
and the force is just:
$$ F = \frac{1}{4\pi\epsilon_0}\frac{Q_1Q_2}{d^2} = \frac{1}{4\pi\epsilon_0}\frac{Q_1Q_2}{(r - t + t\sqrt{K})^2} $$
This is how you get the force when the space between the charges is only partially filled by the dielectric.
Take the distance between the charges as $D$, and we'll assume that the dielectric constant, $K$, at a distance $x$ between the charges is given by some function $f(x)$. Actually let's assume that $f(x)$ gives $\sqrt{K}$ as this makes the notation clearer.
If you take some small element $dx$, then the effective length of this element is $\sqrt{K}\, dx = f(x)\, dx$. We get the total effective length by integrating to add up all the $dx$s, so the total effective length $L$ is:
$$ L = \int_0^D f(x)\, dx $$
And that's it. You need to work out what function $f(x)$ gives you $\sqrt{K}$ at a distance $x$ between the charges, then do the integration to work out $L$. Finally, the force is just:
$$ F = \frac{kq_1q_2}{L^2} $$
Best Answer
The charges are still the same. Only the dielectric medium is varied. So, it's easier than you think...
Both the forces differ only by the relative permittivity $\epsilon_r$.
Hence the relation, $$\frac{F}{F_m}=\frac{\epsilon}{\epsilon_0}=\epsilon_r$$