sgu 143 simple tree dp