My code for Topcoder marathon matches