Some basic algorithms for contest purpose.