solutions for topcoder copetetions.