dinner savage problem java