Let the distance be x km and time taken is t.
Now Speed$\times$Time=Distance
First man will cover distance in 3t time.
Since Second man arrives half an hour before the first one so second man will cover the same distance in 3.5(t-1/2)
So 3t=3.75(t-$\frac{1}{2}$)
After solving we get
t=2.5
So the distance is 3$\times$2.5=7.5Km