Answer: split the cookies in half and throw 1 cookie away
Explanation: This question is not too specific so i cannot answer it to my full capacity but if there are 40 and 20 cookies split them and if 2 of those friends cannot eat it you can play a game to see who gets those pieces of cookies or throw them away or eat them yourself.