The item having less unit rate is best to buy.
1) 400g of flour £1.05.
Weight of flour = 400g
Cost = £1.05
Cost of 1g flour = 1.05/400
= £0.002625
2) 500g of flour £1.30
Weight of flour = 500g
Cost = £1.30
Cost of 1g flour =1.30/500
= £0.0026
£0.0026 is less then £0.002625.
So 500g of flour £1.30 is best to buy