0.5kg is the same as 500g.
Let x = the unknown cost of 300g. We will use this to set up a proportion and crossmultiply.
[tex] \frac{500g}{30p} = \frac{300g}{x} [/tex]
Now crossmultiply and solve for x.
500x = 300(30)
500x = 9000
x = 18
300 grams cost 18p