The diagram has a scale of 1cm to 4km as the problem said, then we can write
[tex]1\operatorname{cm}\colon4\operatorname{km}[/tex]If we want to find the scale factor, we must put 4km in cm, it will be 400000 cm, therefore
[tex]1\operatorname{cm}\colon400000\operatorname{cm}[/tex]Now we have them in the same units, we can "cut" the units on both sides, and we have
[tex]1\colon400000[/tex]We can also write it as a fraction:
[tex]\text{scale factor=}\frac{1}{400000}[/tex]