Ok so just add 3 kg + 1 kg for the first one then it’s 4 kg u bought in total so then $21 divided by 4 kg gives you the cost for each kg of candy then second part u do 3 kg + 3 kg then it’s 6 kg in total then u divide $39 with 6 kg then u get the cost of each kg of candy for this one . Thus, after u already have the price for each kg of candy for both :) hope this helps !