I tried this problem multiple time but still couldn't solve it. Too much book keeping and conditions. can someone please help? Thank you.