Rename files to fit requirement
Add test cases from TA
Modify to fit CS server

Include cstdlib for malloc.
The server not support c++11, so replace stoi to using stringstream.