codechef; solve "Cooling Pies"