Solutions for Topcoder SRM competitions