finish first-round cpp solutions. Close #3